我要将垂直柱形图转换为水平堆叠条形图。我使用带有chart.js 3.0测试版的chartkick-vue 0.61。
我当前的代码:
<column-chart :data="chartData" suffix="%"
height="200px"
:colors="[['#28a745', '#007bff', '#ffc107', '#dc3545']]">
</column-chart>以这种方式呈现:

我找到了这个doc,但我不知道如何将它传递给chartkick-vue,所以我从水平条开始:
<bar-chart
:data="chartData"
suffix="%"
height="200px"
:colors="[['#28a745', '#007bff', '#ffc107', '#dc3545']]"
>但失败的原因是:
Error Loading Chart: "horizontalBar" is not a registered controller这是代码沙箱:https://codesandbox.io/s/pensive-williamson-upohe
我该怎么解决呢?
发布于 2020-11-11 11:29:56
发布于 2021-05-18 19:41:48
现在,选项中实际上是带有indexAxis: 'y'的type: 'bar'。请参阅https://www.chartjs.org/docs/latest/samples/bar/horizontal.html
https://stackoverflow.com/questions/64777164
复制相似问题