如何在HighCharts上绘制垂直线?

R3t*_*tep 25 highcharts

我想跟踪当天的垂直时间线,但我没有在HighCharts文档中找到解决方案.

像这样 :

在此输入图像描述

gpg*_*kko 41

你正在寻找一条情节线.请参阅此处的文档:http://api.highcharts.com/highcharts#xAxis.plotLines.

基本格式是:

xAxis: {
    plotLines: [{
        color: '#FF0000', // Red
        width: 2,
        value: 5.5 // Position, you'll have to translate this to the values on your x axis
    }]
},
Run Code Online (Sandbox Code Playgroud)

  • 有没有办法动态添加/删除情节线?xAxis[0].addPlotLine({ color: 'red', width: 1, value: <variable> }) 添加绘图线,但它会累积 (6认同)