How to add target line in google column chart?

后端 未结 4 1625
感情败类
感情败类 2020-12-15 17:03

How to add the target line in google column chart like this.

\"google

4条回答
  •  既然无缘
    2020-12-15 17:08

    To make the steppedArea @Ryan suggested above a litte bit less awkward, you can setup a second (right) axis and set the base line to the value you want for the target line. The second axis will be setup for the seppedArea data. This avoids the uggly outline effect when you hover the pointer over the chart and under the line. Do something like this in the options:

    var options = {
        seriesType: "line",
        series: {5: {
            type: "steppedArea", 
            color: '#FF0000', 
            visibleInLegend: false, 
            areaOpacity: 0,
            targetAxisIndex: 1 } //tell the series values to be shown in axe 1 bellow
        },
        vAxes: [  //each object in this array refers to one axe setup
            {},  //axe 0 without any special configurations
            {
                ticks: [250], //use this if you want to show the target value
                baseline: 250 //this shifts the base line to 250
            }
        ]
    };
    

提交回复
热议问题