Skip to content

RadarChart 雷达图

基于 ECharts 封装的雷达图组件,适用于多维度数据对比。

基础用法

vue
<script setup>
import { radarChart } from '@twi1i9ht/visual-lib'

const indicators = [
  { name: '销售', max: 6500 },
  { name: '管理', max: 16000 },
  { name: '信息技术', max: 30000 },
  { name: '客服', max: 38000 },
  { name: '研发', max: 52000 },
  { name: '市场', max: 25000 },
]

const seriesData = [
  { name: '预算', value: [4200, 3000, 20000, 35000, 50000, 18000] },
  { name: '实际开销', value: [5000, 14000, 28000, 26000, 42000, 21000] },
]
</script>

<template>
  <radarChart :indicators="indicators" :series-data="seriesData" title="预算与开销" />
</template>

Props

属性类型默认值说明
indicatorsArray<{ name: string, max: number }>指示器配置
seriesDataArray<{ name: string, value: number[] }>系列数据
titlestring图表标题
seriesNamestring系列名称
radarShape'polygon' | 'circle''polygon'雷达图形状
splitNumbernumber5分割段数
axisNameColorstring指示器名称颜色
showAreabooleantrue是否显示填充区域
areaOpacitynumber0.3填充区域透明度
optionEChartsOption高级配置

Released under the MIT License.