how to change am-pm to 24 hr
Posted: Wed Feb 09, 2011 4:37 am
Steema Software - Customer Support Forums
http://teechart.com/support/
Code: Select all
private void InitializeChart()
{ //var
Random rnd = new Random();
DateTime today = DateTime.Today;
TimeSpan oneDay = TimeSpan.FromDays(1);
//Initialize
tChart1.Aspect.View3D = false;
tChart1.Dock = DockStyle.Fill;
Steema.TeeChart.Styles.FastLine series1 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
Steema.TeeChart.Styles.FastLine series2 = new Steema.TeeChart.Styles.FastLine(tChart1.Chart);
//Series Data
series1.XValues.DateTime = true;
series2.XValues.DateTime = true;
for (int i = 1; i <= 5; ++i)
{
series1.Add(today, rnd.Next(100), Color.Red);
series2.Add(today, rnd.Next(100), Color.Blue);
today += oneDay;
}
//Axes
tChart1.Zoomed += new EventHandler(tChart1_Zoomed);
tChart1.UndoneZoom += new EventHandler(tChart1_UndoneZoom);
}
void tChart1_UndoneZoom(object sender, EventArgs e)
{
tChart1.Axes.Bottom.Labels.DateTimeFormat = "dd/MM/yyyy";
tChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.OneDay);
}
void tChart1_Zoomed(object sender, EventArgs e)
{
tChart1.Axes.Bottom.Labels.DateTimeFormat = "HH:mm";
tChart1.Axes.Bottom.Increment = Steema.TeeChart.Utils.GetDateTimeStep(Steema.TeeChart.DateTimeSteps.SixHours);
}