Skip to content
Advertisement

Chart.js – draw horizontal line in Bar Chart (type bar)

Good evening , I want to draw a horizontal line on a graph Bar Chart using Chart.js .

I read the question Chart.js – draw horizontal line and I could not draw the line on a Bar Chart, as indicated is the implementation for Line Chart.

My code is implemented to jsfiddle

HTML

JavaScript

JS

JavaScript

and it would be able to draw the horizontal line, obtaining a graph of the form: http://i.stack.imgur.com/QlOKG.png

Advertisement

Answer

HTML:

JavaScript

JS:

JavaScript

Here is the fiddle: http://jsfiddle.net/zk9oc4c9/

Important: I changed the Chart.js library URL to: http://www.chartjs.org/assets/Chart.min.js

And removed https from the fiddle.

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