找回密码
 立即注册

QQ登录

只需一步,快速开始

nimotea

超级版主

23

主题

95

帖子

536

积分

超级版主

Rank: 8Rank: 8

积分
536
nimotea
超级版主   /  发表于:2024-1-30 09:37  /   查看:508  /  回复:0
效果
image.png436961669.png

拷贝代码
  1. let total_name = "总计";

  2. let num = 0;
  3. let accumulateValue = [];
  4. option.xAxis.data.reverse().push({
  5. value:total_name
  6. });
  7. option.xAxis.data.reverse();


  8. option.series[0].data.reverse().map(item=>{
  9.         accumulateValue.push(num);  
  10.         num += item.value;
  11. })
  12. accumulateValue.push(0);
  13. accumulateValue = accumulateValue.reverse();


  14. option.series[0].data.push({
  15. itemStyle : {
  16.         opacity : 1
  17. },
  18.   value:num
  19. });
  20. option.series[0].data.reverse();
  21. option.series[0].stack = 'Total';
  22. option.series= [
  23.   {
  24.       name: 'Placeholder',
  25.       type: 'bar',
  26.       stack: 'Total',
  27.       itemStyle: {
  28.         borderColor: 'transparent',
  29.         color: 'transparent'
  30.       },
  31.       emphasis: {
  32.         itemStyle: {
  33.           borderColor: 'transparent',
  34.           color: 'transparent'
  35.         }
  36.       },
  37.       data: accumulateValue

  38.   },
  39. ...option.series
  40. ];



  41. return option;
复制代码
方式1:
在Wyn管理后台的【导入】功能,导入以下Zip包,然后在仪表板设计器的左侧工具箱的【组件模板分类中】可以找到。
瀑布图.zip (428.24 KB, 下载次数: 22)

0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部