-
-
Notifications
You must be signed in to change notification settings - Fork 753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如何默认选中折线图某个点 #1532
Labels
Comments
参考 demo 中的如下配置示例, 运行查看交互效果: //https://api.highcharts.com/highcharts/plotOptions.series.marker.states.hover
//https://api.highcharts.com/highcharts/plotOptions.series.events.mouseOver
//https://api.highcharts.com/class-reference/Highcharts.Point#select
//https://github.com/AAChartModel/AAChartKit/issues/1532
+ (AAOptions *)defaultSelectedAPointForLineChart {
AADataElement *defaultPointData = AADataElement.new
.ySet(@29.9)
.selectedSet(@true);
NSArray *dataArr = @[@29.9, @71.5, @106.4, @129.2, @144.0, @176.0, @135.6, @148.5, @216.4, @194.1, @95.6, defaultPointData];
NSInteger defaultPointIndex = dataArr.count - 1;
AAOptions *options = AAOptions.new
.xAxisSet(AAXAxis.new
.categoriesSet(@[@"Jan", @"Feb", @"Mar", @"Apr", @"May", @"Jun", @"Jul", @"Aug", @"Sep", @"Oct", @"Nov", @"Dec"]))
.plotOptionsSet(AAPlotOptions.new
.seriesSet(AASeries.new
.eventsSet(AASeriesEvents.new
.mouseOverSet([NSString stringWithFormat:@AAJSFunc(function () {
if(this.hasRun) return;
var series = this;
var defaultPointIndex = %ld;
if (series.data.length > defaultPointIndex) {
defaultPoint = series.data[defaultPointIndex];
defaultPoint.select(false);
}
this.hasRun = true;
}), (long)defaultPointIndex]))
.allowPointSelectSet(@true)
.markerSet(AAMarker.new
.statesSet(AAMarkerStates.new
.selectSet(AAMarkerSelect.new
.fillColorSet(@"red")
.lineWidthSet(@10)
.lineColorSet(@"yellow")
.radiusSet(@20))))))
.seriesSet(@[
AASeriesElement.new
.dataSet(dataArr)
]);
return options;
} |
|
AAChartModel
added a commit
to AAChartModel/AAChartKit-Swift
that referenced
this issue
Jan 29, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
第一张图是设计图,第二张时我添加的marker,以下是代码片段
但是我滑动时,添加的marker是不会消失的,还是半径5,怎么在滑动时,让他消失,也就是默认选中某个点,而不是我这样手动加上这个点,最终呈现这样的
The text was updated successfully, but these errors were encountered: