Pre loader

SCIGeneric from double

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

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

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
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
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies