【发布时间】:2016-04-13 13:49:17
【问题描述】:
我有以下图表:http://jsfiddle.net/5oso60oq/
JS:
$(function () {
$('#container').highcharts({
chart: {
type: 'bar'
},
title: {
text: 'Stacked bar chart'
},
xAxis: {
categories: ['Apples', 'Oranges', 'Pears', 'Grapes', 'Bananas']
},
yAxis: {
min: 0,
title: {
text: 'Total fruit consumption'
}
},
legend: {
reversed: true
},
tooltip: {
shared: true
},
plotOptions: {
series: {
stacking: 'normal'
}
},
series: [{
name: 'John',
data: [5, 3, 4, 7, 2]
}, {
name: 'Jane',
data: [2, 2, 3, 2, 1]
}, {
name: 'Joe',
data: [3, 4, 4, 2, 5]
}]
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; max-width: 800px; height: 400px; margin: 0 auto"></div>
我想做的是根据图表上悬停的系列突出显示(或更改其样式)工具提示的系列元素。
例如,如果我将鼠标悬停在“Apples”图表系列上的绿色区域,我想在工具提示中突出显示“Joe”,等等......
我发现了一些有关悬停事件的提示,但渲染效果不佳。
【问题讨论】:
标签: javascript css angularjs highcharts highcharts-ng