-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Comments
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. |
In my case I want to use |
Mixed line and scatter chart has been fixed in |
@benmccann have you been able to test these since the 2.9 release? |
Closing as fixed |
What about obvious mixing of bars & lines? Is there any special configuration for this? |
You don't need to do much special really. See https://www.chartjs.org/docs/latest/charts/mixed.html |
There are three problems:
scatter
doesn't work with a mixed chart type. The reason is becausecontrollers.scatter
needs to haveshowLines: false
. However, this only gets applied ifchart.type: 'scatter'
.scatter
andlinear
should be able to have their own controller options instead of both fighting for the same global options. Ifchart.data.datasets[0].type = 'scatter'
the scatter defaults don't get taken into consideration.You can't use a bar with a mixed chart type unless you manually set
categoryPercentage
andbarPercentage
.categoryPercentage
andbarPercentage
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 differingcategoryPercentage
andbarPercentage
valueshorizontalBar
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 ofindexScale
andvalueScale
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 #5996The text was updated successfully, but these errors were encountered: