找回密码
 立即注册

QQ登录

只需一步,快速开始

ZenosZeng 讲师达人认证 悬赏达人认证
超级版主   /  发表于:2024-1-12 08:59  /   查看:637  /  回复:0
本帖最后由 ZenosZeng 于 2024-1-12 09:41 编辑

直接看效果:

image.png517930907.png


直接拷贝代码:
  1. <font size="3">//将所有系列显示为三角形
  2. let seriesData = []
  3. option.series[0].data.forEach(item => {
  4.         seriesData.push(item.value)
  5. })

  6. option.series.forEach(item => {
  7.   item.type = 'pictorialBar',
  8.     item.symbol = 'triangle',
  9.         item.barGap = '-60%',
  10.     item.barWidth = '55%'
  11. })

  12. //在所有系列之后,添加一个矩形区域作为背景
  13. var bg =
  14. {
  15.         type: 'bar',
  16.         showBackground:true,
  17.         backgroundStyle : {
  18.         color: 'rgba(180, 180, 180, 0.1)'
  19.       },
  20.         symbol: 'path://M0,10 L10,10 C5.5,10 5.5,5 5,0 C4.5,5 4.5,10 0,10 z',
  21.         itemStyle: {
  22.           normal: {
  23.             color: 'rgba(255, 255, 255, 0)'
  24.           }
  25.         },
  26.         z: '-99',
  27.         data:seriesData
  28.       };
  29. option.series.push(bg);
  30. return option</font>
复制代码


使用方式:
方式1:
在Wyn管理后台的【导入】功能,导入以下Zip包,然后在仪表板设计器的左侧工具箱的【组件模板分类中】可以找到。
柱形图变形样式.zip (417.92 KB, 下载次数: 20)

0 个回复

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