问题
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