Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with charrtJs Doughnut chart #13

Closed
touch2hussain opened this issue May 20, 2015 · 2 comments
Closed

Not working with charrtJs Doughnut chart #13

touch2hussain opened this issue May 20, 2015 · 2 comments

Comments

@touch2hussain
Copy link

var doughnutData = [
{
value: 300,
color:"#F7464A",
highlight: "#FF5A5E",
label: "Critical"
},

    {
      value: 100,
      color: "#FDB45C",
      highlight: "#FFC870",
      label: "Warning"
    }


  ];

$( document ).ready(function() {
var ctx = document.getElementById("chart-area").getContext("2d");

    var myDoughnut1 = new Chart(ctx).Doughnut(doughnutData, {responsive : true});

    legend(document.getElementById("legend"), doughnutData1,myDoughnut1);

});

the legend is not working for me

bebraw added a commit that referenced this issue May 20, 2015
@bebraw
Copy link
Owner

bebraw commented May 20, 2015

I set up a doughnut example. See index.html and src/demo.js. Chart.js.legend is separate from Chart.js. It just happens to operate on the same format as Chart.js.

Btw you might have a typo at your code. Maybe it should be something like this: legend(document.getElementById("legend"), doughnutData,myDoughnut1);. It needs to refer to the same data at the chart.

@bebraw
Copy link
Owner

bebraw commented Mar 5, 2017

Hi,

Chart.js provides a legend now.

@bebraw bebraw closed this as completed Mar 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants