Hello,
I have a line chart with two series elements. both series represent RSSI updates from BLE hardware every 1 second.
Here's How I create the series:
`AASeriesElement *sensorSeries = AASeriesElement.new;
sensorSeries.name = @"Sensor";
sensorSeries.size = [NSNumber numberWithInt:15];
Added Both to the model then draw the chart as below:
self.aaChartModel = AAChartModel.new .chartTypeSet(AAChartTypeLine) .titleSet(@"RSSI data") //.subtitleSet(@"virtual data") .categoriesSet(@[@"1", @"2", @"3", @"4",@"5", @"6", @"7", @"8", @"9", @"10",@"11", @"12", @"13", @"14",@"15"]) //.yAxisTitleSet(@"y axis") .seriesSet(@[ sensorSeries, streamingSeries ]);
`self.aaChartModel.yAxisMin = [NSNumber numberWithInt:-100];
self.aaChartModel.yAxisMax = [NSNumber numberWithInt:-10];
self.aaChartModel.backgroundColor = @"black";
self.aaChartModel.xAxisLabelsStyleSet(AAObject(AAStyle).colorSet(AAColor.whiteColor));
self.aaChartModel.yAxisLabelsStyleSet(AAObject(AAStyle).colorSet(AAColor.whiteColor));
//draw with model
[self.aaChartView aa_drawChartWithChartModel:self.aaChartModel];`
When trying to update the chart with RSSI live data, it doesn't respect the series data size, the second series doesn't look right as it shrinks to the left and the chart clumps up if I keep it running for long time.
Using one series working fine though!!
Please check the attached picture
EDIT:
update method:
`
-(void)updateChart{
NSArray<AASeriesElement > series = self.aaChartModel.series;
Hello, I have a line chart with two series elements. both series represent RSSI updates from BLE hardware every 1 second. Here's How I create the series: `AASeriesElement *sensorSeries = AASeriesElement.new; sensorSeries.name = @"Sensor"; sensorSeries.size = [NSNumber numberWithInt:15];
Added Both to the model then draw the chart as below:
self.aaChartModel = AAChartModel.new .chartTypeSet(AAChartTypeLine) .titleSet(@"RSSI data") //.subtitleSet(@"virtual data") .categoriesSet(@[@"1", @"2", @"3", @"4",@"5", @"6", @"7", @"8", @"9", @"10",@"11", @"12", @"13", @"14",@"15"]) //.yAxisTitleSet(@"y axis") .seriesSet(@[ sensorSeries, streamingSeries ]);
When trying to update the chart with RSSI live data, it doesn't respect the series data size, the second series doesn't look right as it shrinks to the left and the chart clumps up if I keep it running for long time. Using one series working fine though!! Please check the attached picture![IMG_789B0C851E75-1](https://github.com/AAChartModel/AAChartKit/assets/74717541/348d6b66-4f55-4d70-8c21-67bf5140a562)
EDIT: update method: ` -(void)updateChart{ NSArray<AASeriesElement > series = self.aaChartModel.series;
}`
What I'm doing wrong? Thanks in advance for taking the time to look into it