Hello
in this example datetime is not shown correctly( we do not see 24 hour format )
tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yy hh:mm";
tChart1.Axes.Bottom.Labels.Angle = 90;
line1.XValues.DateTime = true;
DateTime dt = DateTime.Today;
for (int i = 0; i < 48; i++)
{
line1.Add(dt, i);
dt = dt.AddMinutes(30);
}
WPF Chart DateTime Format problem
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi MGV,
To achieve what you request you need to set DateTimeFormat as described in Custom Date and Time Format Strings, for example:
To achieve what you request you need to set DateTimeFormat as described in Custom Date and Time Format Strings, for example:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yy HH:mm";
tChart1.Axes.Bottom.Labels.Angle = 90;
line1.XValues.DateTime = true;
DateTime dt = DateTime.Today;
for (int i = 0; i < 48; i++)
{
line1.Add(dt, i);
dt = dt.AddMinutes(30);
}
}
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |