gpt4 book ai didi

javascript - 使用透明系列时 Highcharts 栏缩放问题

转载 作者:行者123 更新时间:2023-11-30 05:33:47 25 4
gpt4 key购买 nike

在使用透明 内容时,我遇到了一种奇怪的Highchart 缩放 行为。

很难解释,所以我准备了a quick video to show it .

你遇到过这样的问题吗?

提前致谢!

编辑:JSFiddle

还有代码:

$(function () {

$('#roadmap-training').highcharts({
chart: {
type: 'bar',
zoomType: 'y'
},
yAxis: {
type: 'datetime',
min: new Date(2014, 0, 1).getTime(),
max: new Date(2014, 11, 31).getTime(),
},
plotOptions: {
series: {
stacking: "normal"
},
},
tooltip: {
positioner: function () {
return { x: 10, y: 35 };
},
},
series: [
{
data: [
{
y: 864000000,
},
{
y: 12960000000,
}
]
},

{
data: [
{
y: new Date(2014, 1, 1).getTime(),
color: 'transparent'
},
{
y: new Date(2014, 8, 1).getTime(),
color: 'transparent'
}
]
}
]
});
});

这是我用这种方式生成的真实世界示例图: enter image description here

最佳答案

使用透明系列的原因是什么?为什么不使用列范围类型?就像这样:http://jsfiddle.net/Fusher/yfz4usw5/

    series: [{
data: [{
high: new Date(2014, 1, 1).getTime() + 864000000,
low: new Date(2014, 1, 1).getTime(),
}, {
high: new Date(2014, 8, 1).getTime() + 12960000000,
low: new Date(2014, 8, 1).getTime(),
}]
}]

有时确实会出现问题,但很难猜测是什么原因。

关于javascript - 使用透明系列时 Highcharts 栏缩放问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25247450/

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