Closed CoderLR closed 3 months ago
参考此次提交的内容:
关键内容为:
- (void)showOrHideDataPointOfSeriesElementWithDataPointIndex:(NSUInteger)dataPointIndex isVisible:(BOOL)isVisible {
NSString *jsStr = [NSString stringWithFormat:@AAJSFunc(function showDataPoint(pointIndex, visibility) {
let point = aaGlobalChart.series[0].data[pointIndex];
point.setVisible(visibility);
}
showDataPoint(%tu, %u)), dataPointIndex, isVisible];
[self.aaChartView evaluateJavaScript:jsStr completionHandler:^(id item, NSError * _Nullable error) {
NSLog(@"%@",error);
}];
NSLog(@"隐藏或显示 dataPointIndex 值为 %tu", dataPointIndex);
}
折线图可以使用aa_hideTheSeriesElementContentWithSeriesElementIndex、aa_showTheSeriesElementContentWithSeriesElementIndex来控制Series的显示和隐藏。 但是,饼图的话只有一个Series,请问我点击自定义的图例调用什么方法来显示和隐藏呢?