Global datasets options thought
See original GitHub issueDocumentation Is:
- Missing or needed
- Confusing
- Not Sure?
Current documentation
Having a look to the current documentation, the chain to set the datasets options is:
- per dataset: dataset.*
- per chart: options.datasets[type].*
- or globally: Chart.defaults.global.datasets[type].*
What’s not clear
There is another default setting for chart type, where global chart settings are stored in Chart.defaults[type]
.
Does it mean that you can set the datasets options also at global chart level?
If yes, with Chart.defaults[type].dataset
object?
If not, is this missing or not applicable?
In my personal (and not relevant) opinion, the datasets object related to chart type should be defined into global chart options (Chart.defaults[type].dataset
) and not into default options (Chart.defaults.global.datasets[type]
) because you have already options for chart type.
Am I wrong?
About the chain, element
objects are always overlap by datasets
ones, therefore my understanding is datasets options are evaluated with the following priority:
- per dataset: dataset.*
- per chart: options.datasets[type].*
- per globally: Chart.defaults.global.datasets[type].*
- per chart: options.elements.*
- per global chart: Chart.defaults[type].elements.*
- per global options: Chart.defaults.global.elements.*
Correct?
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (18 by maintainers)
Top GitHub Comments
Yes, I agree we should remove the
options.elements.*
Regarding
Chart.defaults[type].dataset
vsChart.defaults.datasets[type]
- One nice thing about theChart.defaults.datasets[type]
version is that the code to resolve the options can easily get the chart-level and dataset-level defaults separately and apply them in the correct order. Though I suppose it should be easy enough either way reallyThank you @kurkle I have seen and not a big deal. I’m gonna change the code with new specification in next weeks, together with the other changes (like font color, tooltip/legend/title). I want to wait for while because I: