We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SecondaryAxis Value Type of Chart Control

the secondaryaxis value type is double in chart control.
Can I use other type data,for example: TimeSpan.
Detail:
the value is double type, such as "3000" in chart demo provided by Syncfusion.Can I change "3000" into "10:30:45" in data format.



Chart_d8b29ff4.rar

3 Replies

GA Ganesan Syncfusion Team November 6, 2011 12:51 AM UTC

Hi,

We would like to inform you that you can change the datatype of the axis labels by specifying the "ValueType" property of the ChartAxis =DateTime.

Code Snippet
[C#]
chart.Areas[0].PrimaryAxis.ValueType = ChartValueType.DateTime;
chart.Areas[0].PrimaryAxis.LabelDateTimeFormat = "MM/dd/yyyy";

We have also prepared a simple sample based on the requiremnet reported,Kindly download the sample from the following link.

DateTimeRange-842678279.zip

In this sample,we have fromatted the x-axis as specifed in this previous update of this forum.

Regards,
Ganesan




TW Tom Wang November 7, 2011 03:20 AM UTC

Thanks for Ganesan's replies.
But I want to change the data format of "SecondaryAxis",it is not "PrimatryAxis".the data format is double type in "SecondaryAxis".I want change "double" format into "TimeSpan".
such as "10:20:30".



GA Ganesan Syncfusion Team November 7, 2011 03:01 PM UTC

Hi Tom,

We would like to inform you that you can change the datatype of the both secondary/Primary axis labels by specifying the "ValueType" property of the corresponding ChartAxis =DateTime.


Code Snippet
[C#]
chart.Areas[0].SecondaryAxis.ValueType = ChartValueType.DateTime;
chart.Areas[0].SecondaryAxis.LabelDateTimeFormat = "hh:mm:ss";

We have also modified our previous sample provided accordingly,kindly download the same from the following link

DateTimeRange1137948507.zip


Please let us know if you need any further assistance.


Thanks,
Ganesan


Loader.
Live Chat Icon For mobile
Up arrow icon