Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

add legends

Open mef opened this issue 13 years ago • 4 comments

I did not find any hint on how to include a legend in the documentation.

Is this supported? Charts look good, but a legend is needed to let reader know about the data series he is looking at...

mef avatar Mar 18 '13 08:03 mef

I haven't planned to add chart legends onto the graph canvas itself, as I felt it would take too much real estate space. It would also be a lot more accessible to have legends as HTML rather than a bitmap canvas.

Chances are, it would be impossible to create enough customisation options to fit everyones layout and style.

I'd suggest using your data source to generate a legend for your graph that fits your needs.

I'd be really interested in seeing what you come up with, and maybe creating a legend add on for Chart.js.

nnnick avatar Mar 18 '13 09:03 nnnick

I am in some urgent need to show legends at my Bar chart, but i don't get any code through which i can achieve this, Please guide me for same. I really appreciate any help on this. ( fixes provided by you only for the tool tip on the charts. (workaround) Is there any way i can show permanent tool tip on my chart, i mean a kind of tool tip which is been shown to all bars independents of user mouse events.

leigends

raghvendrasinghtomar avatar Aug 04 '14 13:08 raghvendrasinghtomar

For anyone else confused by this, chart.js provides a generateLegend function which provides a HTML string of a legend for a given chart, based on a legendTemplate option for the chart. It's covered in the documentation.

liddellj avatar Aug 28 '14 09:08 liddellj

can any one tell me to is there any possible to display values instead of string values. for example : the bar chart have two axis like x and y. normally x have string and y have value of x axis string. But , the y can able to show text instead of range values.

chart

smartgokul avatar Dec 28 '16 09:12 smartgokul