hi
i want to display Axes.Bottom from am-pm to 24 hrs. when i was zooming . How do I ?
how to change am-pm to 24 hr
Re: how to change am-pm to 24 hr
i mean in normal state show only date and when zoom in one day show only time in 24 hour not am/pm...
Re: how to change am-pm to 24 hr
and show full date and time when mouse is over chart
Re: how to change am-pm to 24 hr
Hello aonzuza,
I have made a simple code using Events Zoomed and UndoneZoom and I think you can do something similar as next:
Could you tell us if previous code works as you want?
I hope will helps.
Thanks,
I have made a simple code using Events Zoomed and UndoneZoom and I think you can do something similar as next:
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);
}
I hope will helps.
Thanks,
Best Regards,
Sandra Pazos / 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 |