gpt4 book ai didi

jquery - HighCharts 参数含义 - plotX,plotLeft,shapeArgs

转载 作者:太空宇宙 更新时间:2023-11-04 12:16:01 26 4
gpt4 key购买 nike

谁能告诉我从哪里知道不同系列对象的含义,如 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);
}
}
}
}
}

并查看将鼠标悬停在栏上时获得的值。希望这有帮助

关于jquery - HighCharts 参数含义 - plotX,plotLeft,shapeArgs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28703949/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com