admin管理员组文章数量:1201025
I'm trying to recreate a chart (the one below) using Highcharts. I'm using a basic bar chart, and I'm wondering if there is a way to get a vertical line showing the average of all the bars? I have the value calculated, I just need it to display as the picture shows. Can I do this using Highcharts?
I'm trying to recreate a chart (the one below) using Highcharts. I'm using a basic bar chart, and I'm wondering if there is a way to get a vertical line showing the average of all the bars? I have the value calculated, I just need it to display as the picture shows. Can I do this using Highcharts?
Share Improve this question asked Aug 18, 2014 at 22:01 Ryan McClureRyan McClure 1,2233 gold badges20 silver badges35 bronze badges1 Answer
Reset to default 24Yes. You can add it as a plotline, like this:
yAxis: {
// ...Options
plotLines: [{
color: 'red',
value: '15', // Insert your average here
width: '1',
zIndex: 4 // To not get stuck below the regular plot lines or series
}]
}
See this JSFiddle demonstration.
本文标签: javascriptCan I add an quotaveragequot line to Highcharts ChartStack Overflow
版权声明:本文标题:javascript - Can I add an "average" line to Highcharts Chart? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738580683a2101143.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论