如何将绘图线值扩展到灰色区域之外或图表的图表之外?

问题描述 投票:0回答:1

如何使用highchart将绘图线与灰色背景之外或图表区域之外的值一起延伸。演示:https://jsfiddle.net/mncfy80p/

想要自定义图表,如下图所示。https://i.stack.imgur.com/xbHGh.pngenter code here

javascript highcharts
1个回答
0
投票

您可以增加xAxis占用的空间,并使用plotBands代替plotBackgroundColor属性。

xAxis: {
    labels: {
        enabled: false
    },
    lineWidth: 0,
    tickLength: 0,
    max: 3,
    plotBands: [{
        color: "#D3D3D3",
        from: -1,
        to: 2.5
    }]
}

实时演示: https://jsfiddle.net/BlackLabel/7jcqek36/

API参考: https://api.highcharts.com/highcharts/xAxis.plotBands

© www.soinside.com 2019 - 2024. All rights reserved.