How to add vertical lines to graph with HighStocks or HighCharts?

笑着哭i 提交于 2021-02-10 19:59:15

问题


I have successfully created a chart with HighChart's HighStock. I'm trying to add vertical lines to the chart. I've searched everywhere in HighStock's docs, Stackoverflow and Google on how to do this, but to no avail. I tried HighStock's "flags" but can't create vertical lines with them.

I basically want to turn this chart...

... into something like this:

Is this even possible? If yes, how? Thanks!


回答1:


Yes, These are called plotLines and are easily added like:

xAxis: {
    plotLines: [{
        value: Date.UTC(2015, 3, 15),
        width: 1,
        color: 'green',
        dashStyle: 'dash',
        label: {
            text: 'Latest value',
            align: 'right',
            y: 12,
            x: 0
        }
    }]
},


来源:https://stackoverflow.com/questions/42160969/how-to-add-vertical-lines-to-graph-with-highstocks-or-highcharts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!