类似 (https://www.visactor.io/vchart/demo/bar-chart/stack-column)这样的堆积柱状图,
想要实现不同颜色的柱子都从y轴0刻度开始画,前后重叠,而不是上下堆积,该如何实现?
类似 (https://www.visactor.io/vchart/demo/bar-chart/stack-column)这样的堆积柱状图,
想要实现不同颜色的柱子都从y轴0刻度开始画,前后重叠,而不是上下堆积,该如何实现?
10 回答11.2k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
3 回答4.8k 阅读✓ 已解决
3 回答1.9k 阅读✓ 已解决
1 回答3.1k 阅读✓ 已解决
自己来强答一波。
不同的图表库有不同的解法。提问中的 @visactor/vchart,在堆积柱状图基础上增加了是否堆积的开关。只需要将控制对接的字段设置为false 即可。

代码示例
结果展示
在线效果参考:https://codesandbox.io/s/bar-chart-stack-false-cr6667
相关文档
堆积柱形图demo:https://www.visactor.io/vchart/demo/bar-chart/stack-column
柱形图教程:https://www.visactor.io/vchart/guide/tutorial_docs/Chart_Types/Bar
相关api:https://www.visactor.io/vchart/option/barChart#stack
github:https://github.com/VisActor/VChart