Daylight saving
-
- Newbie
- Posts: 52
- Joined: Tue Mar 04, 2003 5:00 am
Daylight saving
How does the TeeChart handle the switch from and to daylight saving if date is for the x-axis?
Is it not handled or will if be like 02:00....03:00....02:00, when leaving daylight saving?
If it is not handle does it exists some simple way to implement it?
Thanks,
Is it not handled or will if be like 02:00....03:00....02:00, when leaving daylight saving?
If it is not handle does it exists some simple way to implement it?
Thanks,
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
This will depend on the data you add in to teechart, such changes have to be handled manually. There's an example of how you can do this, although in a different context to the one you mention, in the features demo under:
Welcome !\Chart styles\Financial\Candle (OHLC)\Axis Labels no Weekends
This will depend on the data you add in to teechart, such changes have to be handled manually. There's an example of how you can do this, although in a different context to the one you mention, in the features demo under:
Welcome !\Chart styles\Financial\Candle (OHLC)\Axis Labels no Weekends
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
Well, there is another way to look at this. Given that your win app will know the difference between UTC and localtime on any given computer it will be able to make the appropriate addition/subtraction to the DateTime instance before adding the data to the chart. I can't imagine this will represent much overhead either in terms of application performance or in code complexity.
Well, there is another way to look at this. Given that your win app will know the difference between UTC and localtime on any given computer it will be able to make the appropriate addition/subtraction to the DateTime instance before adding the data to the chart. I can't imagine this will represent much overhead either in terms of application performance or in code complexity.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
I don't believe that I've said that I didn't want to do it.
Could you be so kind as to explain to me the kind of simple change you had in mind for Axis.cs?
Thank you very much.
I don't believe that I've said that I didn't want to do it.
Could you be so kind as to explain to me the kind of simple change you had in mind for Axis.cs?
Thank you very much.
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
-
- Site Admin
- Posts: 1349
- Joined: Thu Jan 01, 1970 12:00 am
- Location: Riudellots de la Selva, Catalonia
- Contact:
Hello,
OK, I've added a new property to the AxisLabels class called 'LabelsAsLocalTime' which will become available in the maintenance release due out in September.
In the meantime you can get exactly the same effect with code similar to the following:
OK, I've added a new property to the AxisLabels class called 'LabelsAsLocalTime' which will become available in the maintenance release due out in September.
In the meantime you can get exactly the same effect with code similar to the following:
Code: Select all
private bool labelsAsLocalTime;
private void InitializeChart()
{
int length = 10;
DateTime now = DateTime.Now.ToUniversalTime();
Random rnd = new Random();
tChart1.Axes.Bottom.Labels.DateTimeFormat = "hh:mm";
for (int i = 0; i < length; i++)
{
line1.Add(now, rnd.NextDouble());
now = now.AddHours(1);
}
}
private void button1_Click(object sender, EventArgs e)
{
labelsAsLocalTime = !labelsAsLocalTime;
tChart1.Invalidate();
}
private void tChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
{
if (labelsAsLocalTime && sender.Equals(tChart1.Axes.Bottom))
{
string s = e.LabelText;
DateTime datetime = DateTime.Parse(s);
e.LabelText = datetime.ToLocalTime().ToString(tChart1.Axes.Bottom.Labels.DateTimeFormat);
}
}
Thank you!
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/
Christopher Ireland (Steema crew)
Please be aware of the newsgroup archives:
http://www.teechart.net/support/search.php
http://groups.google.com
http://codenewsfast.com/