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

Overlapping Bar Chart with Smaller Inner Bar & Thicker Outer Bar using 2.7.1 #5224

Closed
zaros opened this issue Feb 1, 2018 · 6 comments
Closed

Comments

@zaros
Copy link

zaros commented Feb 1, 2018

I had tried to implement the solution as referenced in #3946 and this fiddle.

Using 2.4.0 it was working well (-ish! I can't seem to get the bars to align properly)
screen shot 2018-02-02 at 1 09 14 am

However in 2.7.1 I can't get the bars to align at all
screen shot 2018-02-02 at 1 08 34 am

Any idea why it's like this? I was trying to follow the fiddles from #4154 too, but no luck.

@diegoldev
Copy link

I'm having same issue? Is there any update?

@GarethBlain
Copy link

I'm trying to do this as well.
With version 2.4 it works as mentioned: https://jsfiddle.net/zk0w5snu/
1

BUT once you go to 2.5 it no longer overlaps: https://jsfiddle.net/zk0w5snu/1/
2

THEN when you get to 2.7.2 (current) it is got really messed up: https://jsfiddle.net/zk0w5snu/2/
3

I have left all of the x-axis showing as I think some of the issue (at least 2.7.2) is due to that. If you look at 2.4 and 2.5 all the x axis are lined up but 2.7.2 is stretched out so the centre of the end two columns are at the edges of the chart and NOT the edges as it should be...

Hope this helps track it down... 😞

@snksergio
Copy link

I Found this example: https://jsfiddle.net/20wphvow/195/ on #4154

@nagix
Copy link
Contributor

nagix commented May 22, 2019

#4545 introduced the offset scale option, and this is set to false by default in the second category scale. This can be solved by adding offset: true to the second x axis.

scales: {
    xAxes: [{
        id: 'bar-x-axis1',
        // ...
    }, {
        id: 'bar-x-axis2',
        offset: true,
        // ...
    }],
    // ...
}

If you want to overlap bars in different datasets, please also make sure that each dataset has a different xAxisID value, and no stack option is used to specify the ID of the stack group.

See the examples below:
https://jsfiddle.net/nagix/bL8hpk6n/
Screen Shot 2019-05-22 at 6 27 17 PM

https://jsfiddle.net/nagix/n6gozqmt/
Screen Shot 2019-05-22 at 6 27 29 PM

@nagix nagix closed this as completed May 22, 2019
@acetilholin
Copy link

I have 2 overlapped columns. How can I separate them to like on image below?

stacked

https://jsfiddle.net/9dvz051g/2/

@rochiey
Copy link

rochiey commented Jul 27, 2022

I think this does not work on 3.8?

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

9 participants