1

積み重ねられた列と 2 つのスプラインを含むハイチャートがあります。プライマリ yAxis は積み重ねられた列の y 値を表し、セカンダリ yAxis は 2 つのスプラインを表します。デモを見てください。スプラインの y 値の 1 つが正しく表示されていません。スプライン上のポイントにカーソルを合わせると、データが正しいことを確認できますが、表示されている y スケールはそうではありません。「stacking: normal」設定をコメントアウトすると、スプラインが正しく表示されます。

http://jsfiddle.net/chicmob/w2Tux/

これはハイチャートのバグですか、それとも私が見落とした他の設定がありますか?

        chart: {
        type: 'column'
    },
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    plotOptions: {
        series: {
            stacking: 'normal'
        }
    },
    yAxis: [{ // Primary yAxis
        min: 0,
        max: 400,
        tickInterval:100,
    }, { // Secondary yAxis
        min: -40,
        max: 100,
        tickInterval: 20,
        opposite : true,
    }],        

    series: [{
        yAxis : 0,
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }, {
        yAxis : 0,
        data: [144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]
    }, {    
        yAxis : 1,
        type : 'spline',
        data: [35, 60, 77, 56.7, 34, 55, 66, 72, 90, 45, 56, 60]
    } , {    
        yAxis : 1,
        type : 'spline',
        data: [24.3, 12, 41.2, 12.1, 4, 45, 31, 21.5, 9.3, 7.7, 13, 22]
    }]
4

1 に答える 1

1

stacking: 'normal' をすべてのシリーズに適用しています。本当は1st 2シリーズのみに適用したい場合。stacking: 'normal' を plotOptions から取り出し、最初の 2 つのシリーズに入れます。

$('#container').highcharts({
    chart: {
        type: 'column'
    },
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    yAxis: [{ // Primary yAxis
        min: 0,
        max: 400,
        tickInterval:100
    }, { // Secondary yAxis
        min: -40,
        max: 100,
        tickInterval: 20,
        opposite : true
    }],        

    series: [{
        yAxis : 0,
        stacking: 'normal',
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }, {
        yAxis : 0,
        stacking: 'normal',
        data: [144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]
    }, {    
        yAxis : 1,
        type : 'spline',
        data: [35, 60, 77, 56.7, 34, 55, 66, 72, 90, 45, 56, 60]
    } , {    
        yAxis : 1,
        type : 'spline',
        data: [24.3, 12, 41.2, 12.1, 4, 45, 31, 21.5, 9.3, 7.7, 13, 22]
    }]
});

http://jsfiddle.net/w2Tux/2/

于 2013-08-02T00:36:09.290 に答える