【发布时间】:2013-06-17 22:24:12
【问题描述】:
我正在使用包含 50 多行数据和 3 个不同系列的 Highcharts 柱形图 (http://www.highcharts.com/demo/column-basic)。由于这个数量和图表宽度的限制,x 轴标签靠得很近并且成束。
当用户将鼠标悬停在图表中的点/列上时,我想加粗或更改 x 轴标签的颜色。我知道有些事件可以绑定到每个点 (http://api.highcharts.com/highcharts#plotOptions.column.point.events),但我无法将任何样式更改链接到 x 轴标签。这是一个 jsFiddle (http://bit.ly/SpPvCW),其中包含该事件。代码块如下所示:
plotOptions: {
series: {
point: {
events: {
mouseOver: function() {
$reporting.html('x: '+ this.x +', y: '+ this.y);
}
}
},
events: {
mouseOut: function() {
$reporting.empty();
}
}
}
}
这个 jsFiddle (http://jsfiddle.net/4h7DW/1/) 包含一个柱形图,其中 x 轴标签被旋转。
xAxis: {
labels: {
rotation: -70,
align: 'right',
style: {
fontSize: '10px',
color:'#999',
fontFamily: 'Verdana, sans-serif'
}
}
},
同样,目标是在您悬停相关列/点时将 x 轴标签的颜色加粗或更改。
【问题讨论】:
标签: jquery highcharts