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, guys

I have some data series like:

[[SCIXyDataSeries alloc] initWithXType:SCIDataType_DateTime
                                 YType:SCIDataType_Double
                             SeriesType:SCITypeOfDataSeries_XCategory];

Also my Y axis is kind of class SCINumericAxis

So my question is

if i’m trying add value to the series

[volumeSerie appendX:SCIGeneric(bar.time) Y:SCIGeneric([bar.volume doubleValue])];

and my bar.volume is bigger than 2 147 483 648 (float limit as i’m know). It’s leads to a axis range crash. Like on the attached image.

So what should i use to handle huge values?
Like a billions and more

Best regards,
Sushynski Andrei

Version
2.0.0.1458
Images
  • You must to post comments
0
0

Good day

2 147 483 648 is max value for signed int32 and can’t fit in float. It is better to use double instead.
If I get it right you have category date time X axsis, numeric Y axis and Candlestick renderable series.
With that kind of renderable series SCIOhlcDataSeries has to be used. Your data series constructor can look like that:

SCIOhlcDataSeries * ohlcDS = [[SCIOhlcDataSeries alloc] initWithXType:SCIDataType_DateTime YType:SCIDataType_Double SeriesType:SCITypeOfDataSeries_XCategory];

And append method can look like the following:

NSNumber * nY = @(2147483648 + arc4random_uniform(20));
[ohlcDS appendX:SCIGeneric(x)
               Open:SCIGeneric([nY doubleValue] + 1)
               High:SCIGeneric([nY doubleValue] + 3)
                Low:SCIGeneric([nY doubleValue] + 0)
              Close:SCIGeneric([nY doubleValue] + 2)];

Best regards
Andrii
SciChart iOS Developer

  • You must to post comments
0
0

One more time guys

My data series is kind of SCIXyDataSeries

 SCIXyDataSeries *volume = [[SCIXyDataSeries alloc] initWithXType:SCIDataType_DateTime
                                                            YType:SCIDataType_Double
                                                       SeriesType:SCITypeOfDataSeries_XCategory];

and my append method

where the bar.volume is really huge like a billions

[volume appendX:SCIGeneric(bar.time) Y:SCIGeneric([bar.volume doubleValue])];

My y axis is:

 SCINumericAxis *yAxisVolume = [[SCINumericAxis alloc] init];

And i’m using as you advising doubleValue ( [bar.volume doubleValue])

BUT if [bar.volume doubleValue] more then 2 147 483 648 it’s lets to axis range crash

it seems that SCIGeneric() – from double value more than 2 147 483 648 – doesn’t work at all at least for SCIXyDataSeries

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.