How duplicate xAxes in horizontal bar chart ? #9313
Unanswered
maximys963
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there, I'm trying to implement a horizontal bar chart with the same top and bottom xAxis, my config looks like this:
{ datasets: datasets.map((dataset) => ({ backgroundColor: colors.paleGreen, borderColor: colors.paleGreen, borderWidth: 1.5, ...dataset, })), labels, }
{ type: 'horizontalBar', data: {...data}, options: { tooltips: { ...tooltipConfig, }, legend: { display: false, }, scales: { xAxes: [ { position: 'top', gridLines: { color: 'rgba(0, 0, 0, 0)', }, ticks: { suggestedMin: 0, fontFamily: CHART_FONT_FAMILY, fontSize: 11 }, }, ], yAxes: [{ gridLines: { drawBorder: false }, ticks: { fontFamily: CHART_FONT_FAMILY, fontSize: 10, }, }] }, }, }
help me please, when I add a dataset and second object in xAxes with position: 'bottom', the chart renders yAxex labels in the bottom, but I expect duplication xAxes labels, for example, 1, 2, 3, 4 in top and 1, 2, 3, 4 in the bottom. Result 1, 2, 3, 4, in the top and 'lorem', 'iplum', 'dolor', 'sit' in the bottom. I use chart.js 2.9.4 version
Beta Was this translation helpful? Give feedback.
All reactions