We have a date time values on the bottom axis. Export to excel export only the date as string and the time is not saved at all.
We are usin .NET, version 4.1.2011.4192.
The exported file looks as follow:
bellow code example that reproduce the problem<table border="1">
<tr><td>X</td><td>Y</td></tr>
<tr><td>27/04/2011</td><td>20</td></tr>
<tr><td>27/04/2011</td><td>30</td></tr>
<tr><td>27/04/2011</td><td>40</td></tr>
<tr><td>27/04/2011</td><td>50</td></tr>
<tr><td>27/04/2011</td><td>40</td></tr>
</table>
Code: Select all
public Form1()
{
InitializeComponent();
tChart1.Axes.Bottom.Labels.DateTimeFormat = "HH:mm:ss\n";
tChart1.Axes.Bottom.Labels.MultiLine = false;
tChart1.Aspect.View3D = false;
tChart1.Aspect.ZOffset = 0;
Steema.TeeChart.Styles.Line line = new Steema.TeeChart.Styles.Line();
line.XValues.DateTime = true;
line.Pointer.Visible = true;
line.LinePen.Width = 2;
line.TreatNulls = TreatNullsStyle.DoNotPaint;
tChart1.Series.Add(line);
line.Add(DateTime.Now - new TimeSpan(5, 0, 0), 20);
line.Add(DateTime.Now - new TimeSpan(4, 0, 0), 30);
line.Add(DateTime.Now - new TimeSpan(3, 0, 0), 40);
line.Add(DateTime.Now - new TimeSpan(2, 0, 0), 50);
line.Add(DateTime.Now - new TimeSpan(1, 0, 0), 40);
}
private void button1_Click(object sender, EventArgs e)
{
tChart1.Export.Data.Excel.Series = null; // export all series
tChart1.Export.Data.Excel.Save("Chart1.xls");
}