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

Add elements.arc.angle in documentation #6491

Merged
merged 2 commits into from
Sep 7, 2019

Conversation

mp3000mp
Copy link
Contributor

Using elements.arc.angle option can be a workaround for #4751 and make #6472 useless.

Demo here : https://jsfiddle.net/h1e78vbq/

etimberg
etimberg previously approved these changes Sep 2, 2019
kurkle
kurkle previously approved these changes Sep 4, 2019
@@ -82,6 +82,7 @@ Global arc options: `Chart.defaults.global.elements.arc`.

| Name | Type | Default | Description
| ---- | ---- | ------- | -----------
| `angle` | `number` | `circumference / (arc count)` - for polar only | Arc angle to cover.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does "for polar only" mean? That the option is available only for the polar chart or that default is circumference / (arc count) only for the polar chart? If the latter, what is the default for other chart types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have two types of chart using elements.arc :

  • Polar area
  • Pie/Doughnut

I tried to set elements.arc.angleoption in Pie/Doughnut chart. It doesn't override the natural angles computation.

So it seems that this option is available only for polar chart, and I think it's a good thing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I think it might be clearer to put "for polar only" next to the option name rather than the default value. How about:

angle (polar area chart only)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than stating its for polar only, why not move it to

### Styling
The style of each arc can be controlled with the following properties:
| Name | Description
| ---- | ----
| `backgroundColor` | arc background color.
| `borderColor` | arc border color.
| `borderWidth` | arc border width (in pixels).
All these values, if `undefined`, fallback to the associated [`elements.arc.*`](../configuration/elements.md#arc-configuration) options.

Like weight in pie/doughnut

@mp3000mp mp3000mp dismissed stale reviews from kurkle and etimberg via 5e066cb September 5, 2019 22:32
@etimberg etimberg merged commit 6e69a38 into chartjs:master Sep 7, 2019
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Add elements.arc.angle in documentation
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

Successfully merging this pull request may close these issues.

4 participants