Skip to content

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

参数说明类型默认值
optionECharts 配置object-
height图表高度string'400px'
width图表宽度string'100%'

相关链接

基于 MIT 许可发布