当我将鼠标移到折线图the example is with a Bar Chart上时,基本上是从这个主题(How to show label when mouse over bar)中获得灵感,我想要:
1)获取我所经过的序列的点的值
2)获取引用的css选择器
这样我就可以
1)显示值
2)在元素上应用临时CSS (如放大"point“元素)
我试图检查ct-chart对象,但任务被证明是令人生畏的。
在实践中:
var addedEvents = false;
chart.on('draw', function() {
if (!addedEvents) {
$('.ct-bar').on('mouseover', function() {
$('#tooltip').html('<b>Selected Value: </b>' + $(this).attr('ct:value'));
});
$('.ct-bar').on('mouseout', function() {
$('#tooltip').html('<b>Selected Value:</b>');
});
}
});折线图中$(this).attr('ct:value')的等价物是什么?
在图片中(忘了这行吧,我稍后会处理它):
发自:

至:

https://stackoverflow.com/questions/41207593
复制相似问题