Can I add a โ€œmiddleโ€ line to a Highcharts chart?

I am trying to recreate a chart (below) using Highcharts . I am using a basic histogram and I wonder if there is a way to get a vertical line showing the average of all the bars? I have a calculated value, I just need to display it as shown. Can I do this with Highcharts?

enter image description here

+6
source share
2 answers

Yes. You can add it as a storyline, for example:

yAxis: { // ...Options plotLines: [{ color: 'red', value: '15', // Insert your average here width: '1', zIndex: 2 // To not get stuck below the regular plot lines }] } 

See this JSFiddle demo .

+9
source

There are many examples in the HighCharts demo area. One of them has the code that you need http://www.highcharts.com/demo/combo-multi-axes

0
source

Source: https://habr.com/ru/post/974007/


All Articles