Pre loader

Change the labels of a TimeSpanAxisViewModel to show DateTime with DateTimeLabelProvider

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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?

Thanks!

Version
5.4.0.12119
  • You must to post comments
0
0

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:
https://www.scichart.com/documentation/v5.x/webframe.html#Axis%20Labels%20-%20LabelProvider%20API.html

Hope this helps.

With best regards,
Oleksandr

  • 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