Highcharts - 在重绘时停止Y轴值更改

时间:2015-11-27 15:29:43

标签: javascript highcharts

当图形重绘(缩放或调整大小)时,Y轴值会发生变化(最大值会发生变化),图形顶部会留下一个大的白色间隙(无数据)。

这是问题的JsFiddle(包含真实和假数据,结果相同)和一些pictures of my actual graph

这些是我对该图表的选择:

var chartOptions = {
    title: false,

    xAxis: {
        lineWidth: 0,
        type: 'datetime'
    },

    yAxis: [{
        lineWidth: 0,
    },
    {
        lineWidth: 0,
        opposite: true,     
    }],

    tooltip: {
        shared: true
    },

    series: [{
        name: 'A',
        yAxis: 0,
        type : "area",
    },
    {
        name: 'B',
        yAxis: 1,
        type : "area",
    },
    {
        name: 'C',
        type : "spline",
        yAxis: 0,
    }],

    plotOptions: {
        area: {
            threshold: null
        },
    },

    chart: {
        zoomType: 'x',

    },

    legend: {
        enabled: false
    },
};

1 个答案:

答案 0 :(得分:0)

您可以将alignTicks设置为false。示例:http://jsfiddle.net/b1vrvn2q/9

chart: {
        zoomType: 'x',
        alignTicks:false
    },