vendredi 9 juin 2017

How to add chart js legends in ember?

Hello i am new to ember ie its been 2 months since i started using it, so in my ember project i have included a chart js library using http://ift.tt/1NlV5l4 the thing is in my x-axis labels, since the label string is very big i replace the original big string with a,b,c ..etc using

ticks: {
        callback: function(tick, index, array) {
            var alphabet = alphabets: ["a","b","c"];
            if(tick.length > 20){
                return alphabet[index];
                 }
       }

So because of the above function my actual string doesnt get displayed rather a,b,c gets disaplyed enter image description here

So now i want a legend or something to provide description for the a,b,c labels ie something like

a: "this is actual long string" b: " this is another long string"

I came across customize legends in chart.js but i dont know how to configure it with ember

Thanks




Aucun commentaire:

Enregistrer un commentaire