0

負の値と正の値の両方でハイチャートを作成しようとしています。問題は、正の値に比べて、負の値はそれほど大きくないということです。

グラフの写真は次のとおりです。 グラフ

両方の y 軸をよく見ると、0 では一致せず、小さなギャップがあります。両方を0から開始することは可能ですが、負になることはできますか?

これは私のコードです:

Highcharts.chart('chart', {
                chart: {
                    type: 'column'
                },
                title: {
                    text: 'Sales Graph'
                },
                xAxis: {
                    categories: xAxisTicks
                },
                plotOptions: {
                    column: {
                        stacking: 'normal'
                    }
                },
                tooltip: {
                    formatter: function() {
                        debugger;
                        if (this.series.type == "column") {
                            return '<b>' + this.x + '</b><br/>' +
                                this.series.name + ': ' + prettyNumber(this.y) + '<br/>' +
                                'Sales without discount: ' + prettyNumber(this.point.stackTotal);
                        } else {
                            return '<b>' + this.x + '</b><br/>' +
                                this.series.name + ': ' + prettyNumber(this.y) + '<br/>';
                        }
                    }
                },
                colors: ['yellow', 'orange', 'red', 'blue', 'green', 'red', 'blue', 'green'],
                yAxis: [
                {
                    title: {
                        text: 'Daily sales'
                    },
                    min: minYAxisValue,
                    startOnTick: false
                }, {
                    title: {
                        text: 'Accumulated sales'
                    },
                    min: minYAxisValue,
                    startOnTick: false,
                    opposite: true
                }
                ],
                series: data
            });
4

1 に答える 1