Skip to content
Advertisement

How do I add a line on the first bar of a bar chart?

Is it possible to do something as follow (add blue line) ?

enter image description here

The aim is to add a line at the 50% level. The line should be the same length as the bar.

Code :

JavaScript

Advertisement

Answer

You can use hlines. I didn’t know how to set percentage on y axis, hope it will still be useful.

JavaScript

EDIT:

If you want a line above each bar, do something like this:

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement