1

我图表中的 yAxis 是反转的,并且有一个填充区域,这将填充区域放在样条曲线上方。当轴反转时,有没有办法将填充区域保持在样条线下方?

一个工作的jsfiddle在这里

$(function () {
    var chart;
    $(document).ready(function() {
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                type: 'areaspline'
            },
            title: {
                text: 'Average fruit consumption during one week'
            },
            legend: {
                layout: 'vertical',
                align: 'left',
                verticalAlign: 'top',
                x: 150,
                y: 100,
                floating: true,
                borderWidth: 1,
                backgroundColor: '#FFFFFF'
            },
            xAxis: {
                categories: [
                    'Monday',
                    'Tuesday',
                    'Wednesday',
                    'Thursday',
                    'Friday',
                    'Saturday',
                    'Sunday'
                ]
            },
            yAxis: {
                title: {
                    text: 'Fruit units'
                },
                reversed:true,
            },
            tooltip: {
                formatter: function() {
                    return ''+
                    this.x +': '+ this.y +' units';
                }
            },
            credits: {
                enabled: false
            },
            plotOptions: {
                areaspline: {
                    fillOpacity: 0.5
                }
            },
            series: [{
                name: 'John',
                data: [3, 4, 3, 5, 4, 10, 12]
            }, {
                name: 'Jane',
                data: [1, 3, 4, 3, 3, 5, 4]
            }]
        });
    });

});
4

2 回答 2

4

如果您将阈值更改为这样的jsfiddle

highcharts 阈值参考这里

 plotOptions: {
                areaspline: {
                    fillOpacity: 0.5,
                    threshold: 12
                }
于 2013-03-17T11:17:16.947 回答
1

对我有用的是将阈值明确设置为空:

{
    ... (other series properties)
    threshold: null,
    ...
}
于 2016-11-01T10:12:38.927 回答