I have a XamDataChart with several StepLineSeries and I am now adding several ScatterSeries to the chart. When I added the StepLine sources I created new collections and convert all the datapoints' time to local time before I populate the collections, however, for the scatter series I already have all the data in a collection available to me but the time is in UTC. I am trying not to create a new collection just to reproduce all that data with the corrected time. Is there a way to point the scatter series to the collection but run a converter on all the datapoints before they are plotted?
Mike,
I'm not sure if I understand all that you said; why you are converting the datetime to local time.
But I would suggest that the datetimes could all remain in UTC time and you could use a standard datetime format string to convert to local time from the UTC time for a label, if that is required, in which case this link may be helpful to you.
Standard Date and Time Format Strings
http://msdn.microsoft.com/en-us/library/az4se3k1(v=VS.100).aspx
To literally convert between time zones and UTC this may be helpful. Let me know if you need to use a valueconverter.
http://msdn.microsoft.com/en-us/library/bb397769.aspx
You can also identify whether a datetime is UTC or local time when you declare the value.
DateTime dtUTC = new DateTime(2012, 10, 15, 10, 10, 25,DateTimeKind.Utc);
DateTime dtlocal0 = new DateTime(2012, 9, 25, 13, 10, 25,DateTimeKind.Local);
Please let me know if this information is helpful to you.
Thanks Marianne.
The reason I am concerned with timezone is that I am plotting time based data. When the data is saved to SQL server in the DateTime column the timezone portion is lost so when I read data from there I have to specify that it is UTC. Then when I receive it live I do get the timezone info. In addition I need to keep the graph moving whether or not I am receiving data so I use the local time to do that. I was trying to come up with the most efficient way to get all 3 time sources to the same format so that the graph displays properly.
Hi Mike,
I hope the information I provided was helpful.
Please let me know if you have further questions.