-
Notifications
You must be signed in to change notification settings - Fork 12k
Description
From discussion with @simonbrunel over Slack:
Mixed charts today don't work well because we have global options instead of per-controller options (see #4587 for more details). A possible solution would be the one below:
When creating / updating a controllers, we should resolve options from:
dataset.*: per controller/dataset options- the chart
options.* - the
defaults.{datasetType/chartType}.* - the
defaults.global.*
and store the result in a private _config variable in each dataset controller then controllers would not anymore look at the chart.options values only refer to this (the controller)._config
The options cannot always be merged automatically because the names don't match. E.g. global showLines vs. controller/dataset showLine. And pointBackgroundColor vs element.point.backgroundColor
It will be difficult to separate dataset options from attributes like data, _meta, _children and methods like transition and ease that are also defined on the dataset