I'm actualy using Chart JS 2.0.1 to draw charts on a page.
My customers asked me to add a line in a bar chart so that they can see the limit they can't go over. Like that: Bar chart with line on y axes
So, I'm trying to extend the Bar Chart into a new one which takes a parameter called lineAtValue which provides the y value for the line.
I succeeded in extending the bar chart but it overrides the others bar charts displayed in the page and I don't need that in the other Bar Charts.
Here is what I did : http://jsfiddle.net/d5ye1xpe/
And I'd like to be able to have something like this one : jsfiddle.net/L3uhpvd5/ (sorry I can't upload more than two links) with the
Chart.barWithLine(ctx,config);
But with the version 2.0.1 of Chart JS
Thanks,
Ptournem
Mixed type charts are supported by Chart 2.x versions. You can create config like following :-
Created Js Fiddle here: https://jsfiddle.net/nehadeshpande/eu70wzo4/
Please let me know if this is helpful.
Thanks, Neha
This is helpful but I found it not that optimized to add new Dataset just for a line that is actually not a data.
I finally suceeded in creating the new type that extend the bar type and add a line if the value is provided.
But thank you for your help =)
If this helps, I rewrite @Ptournem answer to be a valid 2.3.0 plugin with some sort of configutation