Pre loader

Change the labels of a TimeSpanAxisViewModel to show DateTime with DateTimeLabelProvider


My X Axis is a TimeSpanAxisViewModel but I’d like to be able to toggle between TimeSpan and DateTime to show elapsed time versus actual time.

For example, the axis could read 00:00:00 to 01:30:00 with TimeSpan but then I could toggle the labels to read 3:45PM to 5:15PM, if the starting time was 3:45PM.

Is there a way to provide a starting DateTime and have it used on the axis labels in place of TimeSpan values?


  • You must to post comments

Hi Greg,

Thanks for your inquiry. I am sorry for the late reply.
You can create a custom LabelProvider, pass in a start DateTime and change labels accordingly inside the FormatLabel() method. Also, you can override the OnBeginAxisDraw() method to know when a redraw starts.

Please take a look at the documentation regarding LabelProvider API for more info:

Hope this helps.

With best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies