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

Deprecate Chart.{Type} classes #5868

Merged
merged 1 commit into from Nov 29, 2018

Conversation

simonbrunel
Copy link
Member

@simonbrunel simonbrunel commented Nov 28, 2018

Deprecate the following classes:

  • Chart.Bar
  • Chart.Bubble
  • Chart.Doughnut
  • Chart.Line
  • Chart.PolarArea
  • Chart.Radar
  • Chart.Scatter

It looks like a legacy from version 1 but we actually never promoted their usage. Instead, the regular way to create a chart is to set the type in the config, for example: new Chart(ctx, {type: 'bar'}). Some types are currently missing (no Chart.HorizontalBar or Chart.Pie) but it's also not scalable because it can easily conflict with other classes scoped under the Chart namespace.

These changes also save ~741 bytes minified ;)

Related to #4478

It looks like these classes are a legacy from version 1 but we actually never promoted their usage. Instead, the regular way to create a chart is to set the type in the config, for example: `new Chart(ctx, {type: 'bar'})`. Some types are actually missing (no `Chart.HorizontalBar` or `Chart.Pie`) but it's also not scalable because it can easily conflict with other classes scoped under the `Chart` namespace.
@simonbrunel simonbrunel added this to the Version 2.8 milestone Nov 28, 2018
@simonbrunel simonbrunel merged commit aa652df into chartjs:master Nov 29, 2018
@simonbrunel simonbrunel deleted the chore/deprecate-charts branch November 29, 2018 21:05
exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
It looks like these classes are a legacy from version 1 but we actually never promoted their usage. Instead, the regular way to create a chart is to set the type in the config, for example: `new Chart(ctx, {type: 'bar'})`. Some types are actually missing (no `Chart.HorizontalBar` or `Chart.Pie`) but it's also not scalable because it can easily conflict with other classes scoped under the `Chart` namespace.
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.

None yet

2 participants