Hello,
I am having some difficulties using a custom DateTickProvider.
I am trying to offset the values to “anchor” the chart to specific local time (see original question at “https://www.scichart.com/questions/android/axis-value-anchor” for details)
class CustomDateTickProvider() : DateTickProvider() {
override fun updateTicks(minorTicks: DoubleValues, majorTicks: DoubleValues) {
// super appears to sometimes recalc based on GMT, and sometimes provide offsets from my previous offsets.
super.updateTicks(minorTicks, majorTicks)
// My offset code here, assumes tick values are GMT based...
}
}
My code usually works, but sometimes it doesn’t. It appears that when I call super.UpdateTicks(..), it usually generates new ticks based on GMT, but sometimes it simply provides a small offset (like when I pan) based on existing tick values. Is that correct?
Is there a way for me to Force updateTicks to always recalculate based on GMT, or a way for me to tell if updateTicks is recalculating based off GMT or just doing offsets on the existing tick marks?
Or should I be going at this in a different direction?
Thank you.
- C Bolton asked 3 years ago
- You must login to post comments
Hi there,
Well it’s hard to tell why these offset occur without seeing input data set which is used to calculate ticks. It’s possible that they could be caused by rounding ticks to be divisible by MajorDelta values ( to produce nice looking labels ) calculated by TickProvider or passed from axis.
Unfortunately we don’t have any API to adjust this behavior – the only way is to create custom TickProvider and override algorithm for generation of ticks to produce output which will work for your case.
Best regards,
Yura
- Yura Khariton answered 3 years ago
- You must login to post comments
Please login first to submit.