-
-
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
柱状体点击之后。再点击就不走方法了 #1332
Comments
点击第一次走了,第二次走不了点击相同的数据 |
#pragma mark - WKScriptMessageHandler
- (void)userContentController:(WKUserContentController *)userContentController
didReceiveScriptMessage:(WKScriptMessage *)message {
} 这个方法在第二次点击相同的祝状不走 |
大佬,有没有方法重置选中状态 |
/// The delegate method of getting move over event message model
/// @param aaChartView The instance object of chart view
/// @param message User finger move over event message model
- (void)aaChartView:(AAChartView *)aaChartView moveOverEventWithMessage:(AAMoveOverEventMessageModel *)message; 或者说这个 block 方法 /// Chart view getting move over event message model
/// @param handler event handler
- (void)moveOverEventHandler:(AAMoveOverEventBlock)handler; 实际上是获取的手指✋🏻或鼠标🖱的滑动方法, 所以重复点击相同的位置, 无法获得交互事件回调. |
所以为 AAChartView 新增了专门获取用户点击事件的方法:
/// Chart view getting click event message model
/// @param handler event handler
- (void)clickEventHandler:(AAClickEventBlock)handler;
/// The delegate method of getting click event message model
/// @param aaChartView The instance object of chart view
/// @param message User finger click event message model
- (void)aaChartView:(AAChartView *)aaChartView clickEventWithMessage:(AAClickEventMessageModel *)message; 推荐使用 block 方式来获取点击事件回调. |
[_aaChartView clickEventHandler:^(AAChartView *aaChartView,
AAClickEventMessageModel *message) {
NSDictionary *messageDic = @{
@"category":message.category,
@"index":@(message.index),
@"name":message.name,
@"offset":message.offset,
@"x":message.x,
@"y":message.y
};
NSString *str1 = [NSString stringWithFormat:@"🖱🖱🖱🖱 clicked point series element name: %@\n",
message.name];
NSString *str2 = [NSString stringWithFormat:@"user finger clicked!!!,get the click event BLOCK message: %@",
messageDic];
NSLog(@"%@%@",str1, str2);
}]; 如上即可获取用户的点击交互事件回调. 回调信息在控制台打印效果大致如下: 2022-05-22 14:00:46.759099+0800 AAChartKitDemo[38107:1314821] 🖱🖱🖱🖱 clicked point series element name: 2018
user finger clicked!!!,get the click event BLOCK message: {
category = Go;
index = 5;
name = 2018;
offset = {
plotX = "271.79166666667";
plotY = "73.06109613656781";
};
x = 5;
y = 22;
} demo 中已新增此示例. 下载运行查看即可. |
参考: 更新 AAChartKit 至最新内容, 即可新增的点击事件回调方法. |
No description provided.
The text was updated successfully, but these errors were encountered: