reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

legendTemplate #32

Closed joshhornby closed 9 years ago

joshhornby commented 9 years ago

In the options object you can add a legendTemplate

Is there a way to render this in a react component?

framerate commented 9 years ago

I'm also curious about this.

jhudson8 commented 9 years ago

Sorry guys, I'm super swamped at work and don't have the time to dig into the code - and don't remember how to do this. If anyone is interested in helping to maintain this project I'm happy to add them as an owner.

adamscybot commented 9 years ago

@jhudson8 I wouldn't mind being added. Have some fixes I would like to publish. Also use this in a major project so have come across a lot of its caveats.

jhudson8 commented 9 years ago

@adamscybot I'm not just looking for someone to add some fixes. I'm looking for someone who will respond to questions, add new features and evaluate pull requests. Are you up for that? If not that's cool - just submit your fixes as PRs and I'll merge them in.

joshhornby commented 9 years ago

@jhudson8 We are using this on a fairly large project so we eager for this to maintain active. I would happily carry out the tasks you stated above.

joshhornby commented 9 years ago

@framerate In order to render the legend this.refs.lineChart.state.chart.generateLegend() will get you a HTML string.

Might also be worth looking at https://facebook.github.io/react/tips/dangerously-set-inner-html.html

jhudson8 commented 9 years ago

@joshhornby done!

mrjumpy commented 8 years ago

Hi, In PieChart, still can't show legendtemplate.

kunalsynerzip commented 8 years ago

+1 Me too can't render the legend for the Pie Chart. Is it possible to have a working example for how to use this?