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

Implement per-dataset type (default and per-chart) options #5999

Merged
merged 11 commits into from
May 6, 2019

Conversation

benmccann
Copy link
Contributor

This fixes mixed line and scatter charts. Issue described in #4587

Closes #5997 & #5151

Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

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

After the discussion in Slack, this seems like a good start!

karma.conf.js Outdated Show resolved Hide resolved
src/controllers/controller.line.js Outdated Show resolved Hide resolved
src/controllers/controller.line.js Outdated Show resolved Hide resolved
src/core/core.datasetController.js Outdated Show resolved Hide resolved
src/controllers/controller.line.js Outdated Show resolved Hide resolved
@benmccann benmccann force-pushed the controller-default-opts branch 5 times, most recently from 15dd6bf to 0b86cf9 Compare January 21, 2019 18:46
src/controllers/controller.line.js Outdated Show resolved Hide resolved
src/controllers/controller.scatter.js Show resolved Hide resolved
src/core/core.datasetController.js Outdated Show resolved Hide resolved
src/core/core.datasetController.js Show resolved Hide resolved
kurkle
kurkle previously approved these changes Jan 22, 2019
Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

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

Looks good to me

Copy link
Member

@simonbrunel simonbrunel left a comment

Choose a reason for hiding this comment

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

A minor update in _defaults.

We also need unit tests per controller (line + scatter) to make sure that dataset defaults are correctly handled for every options. And I guess we also need to update the docs about configuring dataset defaults.

src/core/core.datasetController.js Outdated Show resolved Hide resolved
@benmccann
Copy link
Contributor Author

We also need unit tests per controller (line + scatter) to make sure that dataset defaults are correctly handled for every options.

The line chart showLine option was already well tested. I added additional tests for spanGaps and for scatter's showLine.

And I guess we also need to update the docs about configuring dataset defaults.

We don't allow users to configure default options. defaults._set is private

@benmccann benmccann force-pushed the controller-default-opts branch 4 times, most recently from 3c0bad6 to 1be7103 Compare January 29, 2019 17:25
Copy link
Member

@kurkle kurkle left a comment

Choose a reason for hiding this comment

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

One line to remove and a question to consider.

src/core/core.datasetController.js Show resolved Hide resolved
src/controllers/controller.line.js Outdated Show resolved Hide resolved
@simonbrunel
Copy link
Member

We don't allow users to configure default options. defaults._set is private

_set is indeed an internal helper but users are allowed to modify Chart.defaults.datasets.*. So since we are introducing a new public API that allows users to configure defaults for all dataset options, we should also add unit tests for it.

@benmccann
Copy link
Contributor Author

Ok, I went ahead and added documentation. I had already added unit tests

docs/configuration/README.md Outdated Show resolved Hide resolved
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
@MatsNissen-Lie
Copy link

I want to combined the candlestick chart with a line chart. Is that possible, and if so, how?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants