谁能告诉我从哪里知道不同系列对象的含义,如 plotX、plotLeft 和 all..in highcharts???
我搜索了文档但找不到。
我正在尝试理解这段代码。
$(function () {
$('#container').highcharts({
chart: {
type: 'column'
},
plotOptions: {
column: {
stacking: 'normal',
point: {
events: {
mouseOver: function () {
var chart = this.series.chart,
r = chart.renderer,
shape = this.shapeArgs,
xAxis = this.series.xAxis,
yAxis = this.series.yAxis,
y = yAxis.toPixels(this.total),
x = this.plotX + chart.plotLeft - shape.width / 2,
height = yAxis.toPixels(yAxis.min) - y;
if (chart.hoverStack) {
chart.hoverStack.destroy()
}
chart.hoverStack = r.rect(x, y, shape.width, height).attr({
'stroke-width': 6,
'stroke': 'black',
fill: 'transparent',
}).add();
},
mouseOut: function () {
if (this.series.chart.hoverStack) {
this.series.chart.hoverStack.destroy();
this.series.chart.hoverStack = false
}
}
}
}
}
},
series: [{
type: 'column',
name: 'John',
data: [3, 3, 3, 3, 3]
}, {
type: 'column',
name: 'Bob',
data: [5, 3, 4, 7, 2]
}, {
type: 'column',
name: 'Joe',
data: [2, 2, 2, 2, 2]
}, {
type: 'column',
name: 'Ken',
data: [3, 4, 4, 2, 5]
}]
});
});
http://jsfiddle.net/3Utat/25/
对于栏而不是列,使用:
plotOptions: {
bar: {
point: {
events: {
mouseOver: function(){
console.info(this);
}
}
}
}
}
并查看将鼠标悬停在栏上时获得的值。希望这有帮助
我是一名优秀的程序员,十分优秀!