question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

circumference option in 'chart.options' is undefined

See original GitHub issue

I don’t know if this a bug or I misunderstood the documentation.

The pie/doughnut charts have got some specific options, like , circumference.

From documentation the circumference has got a default of 360 and I’m expecting that when I’m invoking chart.options.circumference I’ll get 360 if I didn’t set it in the configuration of chart:

var myChart = new Chart(ctx, {
    type: 'pie',
    data: {
      labels: ["Jan", "Feb", "Mar"],
      datasets: [{
        label: 'dataset',
        data: [51, 23, 24],
        backgroundColor: 'lightGrey'
      }]
   },
});
console.log(myChart.options.circumference); // <- my expectation is to see 360. Unfortunately is undefined.

https://codepen.io/stockinail/pen/RwoxzNZ

It’s not clear to me where I’m wrong.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
LeeLenaleeecommented, Feb 26, 2021

Was looking at the wrong part of documentation: https://www.chartjs.org/docs/master/charts/doughnut/#dataset-properties

When I override the circumfrence in the options it shows so it looks like it tries to read the option before it got merged https://codepen.io/leelenaleee/pen/RwoQMOJ

0reactions
stockiNailcommented, Feb 26, 2021

Ok… ignore my previous post. You marked as bug therefore the answer is clear.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Doughnut and Pie Charts - Chart.js
# Config Options ; circumference, number, 360, Sweep to allow arcs to cover. ; animation.animateRotate, boolean, true, If true, the chart will ...
Read more >
Chart.js Doughnut Chart Rendering Wrong - Stack Overflow
I'm trying to get the output of a doughnut chart from 0 degrees to 180 degrees (Half of the circle) for practice, So...
Read more >
API Documentation - Chartist.js
Detailed documentation of the Chartist.js code and API.
Read more >
chart.style | highcharts API Reference
Note that for line series and some other series types, the threshold option is set to null by default. This will in turn...
Read more >
Undefined Slope Equation & Examples - Study.com
What Does an Undefined Slope Look Like? The graph of a line with undefined slope. This is the effect of a line defined ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found