echarts 圆柱体(带头部阴影)

<template>
  <div :id="echartsId"></div>
</template>
<script setup>
  import * as echarts from 'echarts'
  import { reactive, ref, onMounted, defineProps, watch, onUnmounted } from 'vue'
  const props = defineProps({
    echartsBool: {
      type: Boolean,
      default: false,
    },
    echartsId: {
      type: String,
      default: 'echartsId',
    },
    // 柱状宽度
    echartsBarWidth: {
      type: String,
      default: '30%',
    },
    // x轴数据
    xAxisDataJson: {
      type: Array,
      default: () => {
        return []
      },
    },
    // y轴数据
    yAxisJson: {
      type: Object,
      default: () => {
        return {
          name: '单位:数量',
        }
      },
    },
    // y轴字体样式
    nameTextStyle: {
      type: Object,
      default: () => {
        return {
          color: '#fff',
          fontSize: 14,
          fontWeight: 400,
          verticalAlign: 'bottom',
          // 左上字体位置
          padding: [0, -20, 10, 20],
          fontFamily: 'PingFang SC',
        }
      },
    },
    //  柱状图颜色
    barColorJson: {
      type: Object,
      default: () => {
        return {
          headColor1: 'rgba(43,194,195,1)',
          headColor2: 'rgba(43,194,195,0.5)',
          upBarColor: 'rgba(30,70,76,0.5)',
          bottomBarColor1: 'rgba(43,194,195,1)',
          bottomBarColor2: 'rgba(43,194,195,0.5)',
          topColor: 'rgba(30,70,76,1)',
        }
      },
    },
    // 数据展示
    dataList: {
      type: Array,
      default: () => {
        return [
          {
            name: '公司1',
            value: 73,
            max: 100,
          },
          {
            name: '公司2',
            value: 18,
            max: 100,
          },
          {
            name: '公司3',
            value: 43,
            max: 100,
          },
          {
            name: '公司4',
            value: 66,
            max: 100,
          },
        ]
      },
    },
    // legend方向
    legendDirection: {
      type: Object,
      default: () => {
        return {
          bottom: '0',
          top: '0',
          left: '0',
          right: '0',
        }
      },
    },
    // grid方向
    gridDirection: {
      type: Object,
      default: () => {
        return {
          bottom: '35',
          top: '25%',
          right: '0%',
          left: '10%',
        }
      },
    },
    // dataListLength 大小==长度约束柱状宽度  定时器==个数 两个不会同时出现大小暂时不用
    dataListLength: {
      type: Number,
      default: 8,
    },
  })
  const dataKey = reactive(['topData', 'bottomBar', 'bottomCircle', 'middleCircle', 'upBar'])
  const dataJs
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值