SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
I would like to implement a custom DateTime axis LabelProvider with the following behavior:
So, an axis might look like:
10/01/2016 23:00 23:30 10/02 00:00 00:30 01:00
It seems this is doable as long as 00:00:00 appears as one of the label values, but I’m not sure l can be guaranteed. It is likely that none of the entries in the series would contain that exact value. One entry might be 23:59:17 and the next 00:01:13.
Is there any way for a LabelProvider to determine what the preceding label value was?
Thanks for your inquiry. The FormatLabel() method is called for every axis label which is going to appear on an axis. So yes, it is possible to implement your desired behavior. Just store a previous date and compare it with current one.
The documentation article on LabelProviders can be found here.
Hope this helps!
This worked great. Thank you.
One more question. Is there a recommended way to force a regeneration of axis labels, other than changing its visible range?. The scaling on my axis depends on an external value . When that value changes, I would like to regenerate the axis labels. I’ve tried nudging the visible range min value up and down, but it seems the labels are not regenerated unless I move the range far enough to be noticeable on screen.
Please login first to submit.