While working with ISCIAnnotation, I encountered such a problem.
After changing the timeframe, I update the positions of the annotations added to the chart relative to the X axis.
To do this, I call the x-axis label provider.
let labelProvider = xAxis.labelProvider as? ISCICategoryLabelProvider
Then I call a method that should transform the Date into the correct index for the current timeframe.let pointAbsoluteX = labelProvider.transformDataToIndex(I give the x-axis coordinate(Date()) for the annotation as a parameter)
Give to transformDataToIndex() 2022-08-12 05:00:00 +0000
and get -1.0
Give to transformDataToIndex() 2022-08-16 07:00:00 +0000
and get -1.0
Tried changing searchMode values: (.exact, .nearest, .roundUp, .roundDown).
Regardless of the selected value, the function still returns -1.0.
But after receiving the first tick for the current quote, the labelProvider.transformDataToIndex function starts returning the correct values.
Give to transformDataToIndex() 2022-08-12 05:00:00 +0000
and get 205.0
Give to transformDataToIndex() 2022-08-16 07:00:00 +0000
and get 207.0
Accordingly, my annotations are displayed incorrectly on the chart until a tick is received for the current quote.
Please tell me how to solve this problem.
- Dmitry Zaljubich asked 5 months ago
- You must login to post comments
Please login first to submit.