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

标签 javascript jquery charts highcharts bar-chart

在使用透明 内容时,我遇到了一种奇怪的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/

相关文章:

javascript - 循环setinterval停止javascript

javascript - Count++ 和 -- 不起作用

javascript - 如何在 EXT JS 中渲染 10,000 多条记录的图表?

javascript - 具有多级嵌套轴标签的图表库

javascript - jQuery ajax 发布未捕获的 RangeError : Maximum call stack size exceeded

javascript - PHP 到 Javascript : dirname and document_root

javascript - 当我在 $scope 中设置数据时,在 bootstrap 模式上获取数据时遇到 angularJs 中的问题

javascript - 如何在 SlideJS 中创建播放/暂停按钮?

javascript - 谷歌图表 API,带注释的时间轴 : properly setup several series and scales

javascript - 具有双轴断点和拖动点的 Highcharts