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

mixed charts / dataset types do not work #4587

Closed
benmccann opened this issue Jul 31, 2017 · 7 comments
Closed

mixed charts / dataset types do not work #4587

benmccann opened this issue Jul 31, 2017 · 7 comments

Comments

@benmccann
Copy link
Contributor

benmccann commented Jul 31, 2017

There are three problems:

  1. scatter doesn't work with a mixed chart type. The reason is because controllers.scatter needs to have showLines: false. However, this only gets applied if chart.type: 'scatter'. scatter and linear should be able to have their own controller options instead of both fighting for the same global options. If chart.data.datasets[0].type = 'scatter' the scatter defaults don't get taken into consideration.

  2. You can't use a bar with a mixed chart type unless you manually set categoryPercentage and barPercentage. categoryPercentage and barPercentage shouldn't be set on the scale because they're options for the bar chart and are not options for the scale. The code currently only sets these values on the category scale which means you can't use a bar chart with other scales that it would be compatible with such as the time scale. These options be set on the dataset and we should have a default value there. This would also allow you to plot multiple bar datasets with differing categoryPercentage and barPercentage values

  3. horizontalBar charts cannot be combined with any other chart type because no other chart supports being horizontal as reported in [FEATURE] Horizontal bar chart in combination with a line chart #4047 & Horizontal Bars mix with lines #4096. The other controllers should be made aware of indexScale and valueScale concepts. For steps towards a solution, see Return correct label for value type axis #5920 and Replace tooltip item xLabel and yLabel with label and value #5996

@rugk
Copy link

rugk commented Jun 11, 2019

When will this be fixed. This whole mixed types do not work?

Even the example on https://www.chartjs.org/docs/latest/charts/mixed.html does not work.

@rugk
Copy link

rugk commented Jun 11, 2019

In my case I want to use line together with scatter. Is there a workaround that makes this possible?

@benmccann
Copy link
Contributor Author

Mixed line and scatter chart has been fixed in master, so will be fixed with the next release

@etimberg
Copy link
Member

etimberg commented Jan 1, 2020

@benmccann have you been able to test these since the 2.9 release?

@benmccann
Copy link
Contributor Author

Closing as fixed

@denrolya
Copy link

What about obvious mixing of bars & lines? Is there any special configuration for this?

@benmccann
Copy link
Contributor Author

You don't need to do much special really. See https://www.chartjs.org/docs/latest/charts/mixed.html

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

No branches or pull requests

5 participants