Skip to content

Per-controller options #5191

@benmccann

Description

@benmccann

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions