SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

0
0

Hi,

I am trying to get the index of a specific date in CategoryDateTime X axis. I was trying to use this approach:

int idxOfMaxAvgScoreDate = [[self.dataSeriesAvg xValues] indexOf:SCIGeneric(dateOfMaxAvgScore) IsSorted:YES SearchMode:SCIArraySearchMode_Exact];

but it was returning -1. My guess is that comparison operator for the DateTime type is “too precise”, so some kind of range check needs to be done, similarly to common practice when comparing two floats:

if (abs(float1-float2) < epsilon)

instead of

if (float1 == float2)

I tried using SCIArraySearchMode_Nearest, but without success – most of the times I get a column right after the one I need (desiredIndex+1).

While trying to implement index lookup myself by iterating through the dataSeries.xValues I noticed that DateTime type decoder is not there for individual elements of SCIArrayControllerProtocol. Autocompletion for line below

[[self.dataSeries xValues] valueAt:i].

offers all typed of data decoding (int16, int32, char…) except dateTime. Is this the way it is supposed to be?

I tried solving it this way:

SCIGenericDate([[self.dataSeries xValues] valueAt:i])

but the date I am getting is always 01-01-1970. This indicates that entries in the X axis are not DateTime elements, which is not true, since this is my X axis:

id<SCIAxis2D> xAxis = [[SCICategoryDateTimeAxis alloc] init];

Any help, or even just thoughts and comments, would be highly appreciated.

Thanks,
Igor

Version
1.2.4
  • You must to post comments
1
0

Hi, Igor Peric

I’ve fixed valueAt in category dataSeries. You can find new fix in new version in our framework.
https://www.scichart.com/Downloads/iOS/v1.2/SciChart_iOS_v1.2.4.1296_SDK.zip

Please feel free to contact us if you need anything else.

Best Regards, Mykola

  • Igor Peric
    Thanks, works like a charm! :)
  • Igor Peric
    Hey Mykola, can you please integrate the fix in 2.0 branch as well? Thanks.
  • You must to post comments
0
0

This fix worked perfectly well in version 1.2. However, just upgrading to 2.0 made the code broken again. When can we expect having the fix in version 2.0? Thanks.

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.