Chart.js: Horizontal Bar : multiple x axes

Created on 23 Aug 2017  路  2Comments  路  Source: chartjs/Chart.js

Hello, after multiple research and test. It wasn't possible to create an horizontalBar graph with multiple X axes.
When I code two x axes, the graph take labels and not my second x axe. That result delete my second bar.

Can you tell me if you have a solution about this problem, thanks.

Example of my problem : https://jsfiddle.net/a2si_wnor/xy2j113d/

support

Most helpful comment

@Wendy59 I got it working by putting the 2nd x axis on the bottom instead of the right and explicitly changing setting the type as 'linear'. https://jsfiddle.net/f8jjwcp3/1/

The reason that the first x axis does not need the type property set explicitly is that it's done in the default config: https://github.com/chartjs/Chart.js/blob/master/src/controllers/controller.bar.js#L43-L44

All 2 comments

@Wendy59 I got it working by putting the 2nd x axis on the bottom instead of the right and explicitly changing setting the type as 'linear'. https://jsfiddle.net/f8jjwcp3/1/

The reason that the first x axis does not need the type property set explicitly is that it's done in the default config: https://github.com/chartjs/Chart.js/blob/master/src/controllers/controller.bar.js#L43-L44

I did not know that an axis had a type. It's good to know, thanks @etimberg !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JAIOMP picture JAIOMP  路  3Comments

adriantombu picture adriantombu  路  3Comments

nanospeck picture nanospeck  路  3Comments

Woogles picture Woogles  路  3Comments

benmccann picture benmccann  路  3Comments