Skip to content

echarts-bary-gradient

示例

vue
<template>
    <echarts-bary :data="data" height="200px" :color="color" />
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { EchartsBary } from 'v3-echarts'

const data = ref({
    axis: ['衬衫', '羊毛衫', '雪纺衫', '裤子', '高跟鞋', '袜子'],
    series: [
        {
            name: '销量',
            data: [5, 20, 36, 10, 10, 20]
        }
    ]
})

const color = [
    {
        type: 'linear',
        x: 1,
        y: 0,
        x2: 0,
        y2: 0,
        colorStops: [
            {
                offset: 0,
                color: '#B392F0'
            },
            {
                offset: 1,
                color: '#E1E4E8'
            }
        ]
    }
]
</script>

props

参数说明类型默认值
width容器高度string100%
height容器高度string100%
data数据源object-
color柱状图颜色array-
bar-width柱状图宽度number8
stack是否堆叠booleanfalse
radius圆角number0
single-color是否独立颜色booleanfalse
show-background是否显示背景booleanfalse
label是否显示数值booleanfalse