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

Stacked Bar Graphs Not Stacked #111

Closed
jmcglory opened this issue May 19, 2020 · 2 comments
Closed

Stacked Bar Graphs Not Stacked #111

jmcglory opened this issue May 19, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@jmcglory
Copy link

Describe the bug

I noticed in my graphs but then checked https://iloveblazor.com/StackedBarChart has the same behaviour. Bars are not stacked on top of each other but seem to be behind each other.

For example on the example column B consists of
Red = 3
Green = 5
Blue = 6

So with all of them on it should total 14 but it only goes up to 6

Chart Js does not behave the same, it stacks them on top of each other
https://www.chartjs.org/samples/latest/charts/bar/stacked.html

Which Blazor project type is your bug related to?
I am using server side but I imagine it affects both

Which charts does this bug apply to?
https://iloveblazor.com/StackedBarChart

Expected behavior

A clear and concise description of what you expected to happen.
On Chart Js the bars generally stay the same size but the axis change to suit.
https://www.chartjs.org/samples/latest/charts/bar/stacked.html

@jmcglory jmcglory added the bug Something isn't working label May 19, 2020
@Joelius300
Copy link
Contributor

Thanks for the report!

You'll need to also make the y-axis stacked as well, otherwise this is the expected behaviour. I have not tested it but try this:

YAxes = new List<CartesianAxis>
{
    new BarLinearAxis
    {
        Stacked = true
    }
}

We should change our sample to reflect the one from chart.js otherwise it just causes confusion. The goal is to port every official chart.js sample to blazor anyway but we're not ready for that yet.

@Joelius300 Joelius300 mentioned this issue Jun 2, 2020
56 tasks
@Joelius300
Copy link
Contributor

Closing this now as the samples have been completely redone for 2.0 and the stacked bar sample now behaves the same as the official Chart.js one. Unfortunately, the samples aren't hosted anywhere yet but if you run them yourself, you should see the expected behaviour.

Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants