[Chartjs]-Creating a horizontal bar chart extension on Chart.js

13👍

Chart.js does not come with horizontal bar charts by default.

However it is built in a very modular fashion. This allows third party plugins to be developed that do not mess with the core code.

As I needed horizontal bar charts for a project I was working on I took the liberty of creating one which you can find here.

https://github.com/tomsouthall/Chart.HorizontalBar.js

You can install it using bower:

$ bower install chart.horizontalbar

The syntax for creating a chart is exactly the same as for creating a standard (vertical) bar chart:

var myChart = new Chart(ctx).HorizontalBar(data, options);

It’s a pretty quickly hacked together project but it worked great for what I needed! Hope it helps.

5👍

I know it might be not helpful to you but might help someone else, google charts are really good take a look at it https://developers.google.com/chart/

Leave a comment