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
- Andrei Sushynski asked 7 years ago
- last edited 7 years ago
- You must login to post comments
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
- Andrii Poliuk answered 7 years ago
-
it’s doesn’t help
- You must login to post comments
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
- Andrei Sushynski answered 7 years ago
- You must login to post comments
Please login first to submit.