ECharts 图表
基于 ECharts 封装的图表组件。
基本用法
vue
<template>
<ECharts :option="chartOption" height="400px" />
</template>
<script setup lang="ts">
const chartOption = ref({
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [
{
data: [150, 230, 224, 218, 135, 147, 260],
type: 'line'
}
]
})
</script>Props
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| option | ECharts 配置 | object | - |
| height | 图表高度 | string | '400px' |
| width | 图表宽度 | string | '100%' |
