放大折线图的高图无法正常工作

highcharts zooming over line charts not working properly

本文关键字:工作 常工作 折线图 高图无 放大      更新时间:2024-01-01

看看下面的fiddle:http://jsfiddle.net/fmarino/q9c31a1g/3/

    $(function () {
    $('#container').highcharts({
      chart: {
            zoomType: 'x'        
      },
      credits: {
            enabled: false
        },        title: {
            text: 'Production per orbit'
        },
        xAxis: {
            crosshair: true,            
            title: {
                text: 'Orbits'
            }        },
        yAxis: {
            min: 0,
            title: {
                text: 'Volume'
            }
        },
        legend: {
            align: 'right',
            x: -30,
            verticalAlign: 'top',
            y: 25,
            floating: true,
            backgroundColor: (Highcharts.theme && Highcharts.theme.background2) || 'white',
            borderColor: '#CCC',
            borderWidth: 1,
            shadow: false        },        tooltip: {
            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y}</b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
        plotOptions: {
            bar: {
                dataLabels: {
                    enabled: true
                }
            },
            column: {
               dataLabels: {
                    enabled: true
                },                
                pointPadding: 0.2,
                borderWidth: 0
            }
        },
       exporting: {
            sourceWidth: 1400,
            sourceHeight: 400,
            // scale: 2 (default)
            chartOptions: {
                subtitle: null
            }
        },        series: [ {
        name: 'Total Size',  
        data: [...]
    });
});

然后试着放大左边的部分。对我(firefox)来说,它只显示缩放后的l2大小。我做错什么了吗?在这样的图表上实现缩放的正确方法是什么?

感谢

正如Halvor所建议的,我的数据没有排序。事实上,它的顺序相反,缺少了一点。

以升序模式对数据进行排序解决了此问题。

谢谢。