Change on stack does not update the chart properly with non-default scaleId
See original GitHub issueExpected Behavior
When I change the stack of one of the datasets, I would like the graph to update correctly.
Current Behavior
Here, the dataset stays in the same place when it should go down
Steps to Reproduce
Example
Here is a link with small datasets where you can see the issue : JsFiddle
Here is what I would like to have when I update the chart : JsFiddle
Chart Config:
const myChart = new Chart(ctx, {
type: "bar",
data: {
labels: ["January", "February", "March", "April", "May", "June"],
datasets: [
{
backgroundColor: "rgba(255,99,132,0.8)",
label: "Dataset 1",
data: [12, 19, 3, 5, 2, 3],
stack: "0"
},
{
backgroundColor: "rgba(54,162,235,0.8)",
label: "Dataset 2",
data: [13, 19, 3, 5, 8, 3],
stack: "0" //When I change this, the chart is not updated correctly
},
{
backgroundColor: "rgba(75,192,192,0.8)",
label: "Dataset 3",
data: [13, 19, 3, 5, 8, 3],
stack: "0"
}
]
},
options: {
scales: {
yAxes: [
{
ticks: {
beginAtZero: true
}
}
]
}
}
});
Context
When I edit a chart, the editing preview is not the same depending on whether I reload the page or not.
Here is when i’m editing:
Then i save the configuration and i update the chart:
Environment
- Chart.js version: 3.2.0
- Browser name and version: Firefox 88.0.1 (64 bits)
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Can't update chart - Stack Overflow
Remember that you assigned the newly created chart to the variable barChart . Therefore, try to change your updateConfigByMutating from.
Read more >Chart.js - Bountysource
Change on stack does not update the chart properly with non-default scaleId $ 0 ... Created 1 year ago in chartjs/Chart.js with 5...
Read more >Updating Charts | Chart.js
Scales can be updated separately without changing other options. To update the scales, pass in an object containing all the customization ...
Read more >chart js show x axis labels
X and Y axis labels are by default disabled in Highmaps, ... If you are still not installed Vue. etimberg added the status:...
Read more >Excel 2013: stacked bar chart with date, updating date issue
A quick and easy fix to your issue is to set the minimum and maximum values for your x-axis to the window which...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@TheoLaperrouse looks like there is another bug in there.
I think this was fixed in #9105