MindFusion.Charting supports DateTime values as data for all its chart types. You can add the DateTime values the same way as you add numbers. You can also use any other data, for example, strings as long as it can be parsed to valid DateTime values.
Data cannot be mixed - for any of the XData, YData or Y2Data properties, you can use either numbers or DateTime values.
Labels at the axis are drawn as DateTime values if you set the DateTimeFormat property to any of the date / time formats - ShortDate, LongDate and so on.
The following sample creates a line chart with 4 DateTime points.
VB
![]() |
---|
'Create the DateTime data |
VB
![]() |
---|
Me.LineChart1.XAxisSettings.EndDateTime = New Date(2008, 2, 20, 0, 0, 0, 0) |
VB
![]() |
---|
Me.LineChart1.XAxisSettings.TimeSpan = System.TimeSpan.Parse("3.00:00:00") |
VB
![]() |
---|
Me.LineChart1.XAxisSettings.DataFormat = MindFusion.Charting.DataFormat.CustomDateTime |
Here is the final chart: