Hi,
First, can X-axis of Scatter Chart set as DateTime?
At the moment, I have tried getting values for x-axis as String and also as DateTime, but none of them work.
In my axis setting, I have done the following:
_chart.Axis.X.Labels.ItemFormatString = "<DATA_VALUE:MM/dd/yyyy>"
(And tried "<DATA_VALUE:MM-dd-yyyy>", <DATA_VALUE:mm-dd-hh> , and all other time syntax)
However, I always got on the graph as the FormatString (and not populated with the actual data).
Am I missing something, or Scatter Chart simply do not support this???
Scatter Chart works only with numeric axis, so it is not possible setting DateTime values.
double axisValue = dateTime.ToOADate();
add them to the chart and show the labels with using IRenderLabel interface:
http://help.infragistics.com/Help/NetAdvantage/NET/2008.3/CLR2.0/html/Chart_Customize_Labels_Using_the_IRenderLabel_Interface.html
and converting the double values to DateTime:
string label = DateTime.FromOADate(axisValue).ToString();
This works for me but when the double value of the axis gets passed to my class that implements IRenderLabel, the value is truncated resulting in a different time when I call
DateTime.FromOADate(axisValue)
Why is the axisValue being passed to the IRenderLabel interface being truncated?