Skip to content

间隙环形图

示例

基础示例

vue
<script setup>
const data = [
  ['Lewis', 86],
  ['Taylor', 71],
  ['Martin', 35],
  ['Clark', 58],
  ['Perez', 80],
]
</script>

<template>
  <div v-ec="['pieGapDoughnut', data]" style="width: 100%; height: 300px;" />
</template>

参数说明

索引类型必填默认值说明
0pieGapDoughnut--
1Data-数据
2OptionsdefaultOptions配置参数
3EcOptions-ECharts 配置参数

参数默认值

options

ts
const defaultOptions: Options = {
  radius: ['40%', '70%'],
  hoverFontSize: 20,
  padAngle: 5,
  hoverColor: 'inherit',
  itemRadius: 7,
}

参数类型

Data

ts
export type Data = (NumberObject | NumberKeyValuePairArray)[]

Options

ts
export interface Options {
  /**
   * @see https://echarts.apache.org/option.html#series-pie.radius
   */
  radius?: string[]

  /**
   * @see https://echarts.apache.org/option.html#series-pie.itemStyle.borderRadius
   */
  itemRadius?: number

  /**
   * @see https://echarts.apache.org/option.html#series-pie.emphasis.label.fontSize
   */
  hoverFontSize?: number

  /**
   * @see https://echarts.apache.org/option.html#series-pie.emphasis.label.color
   */
  hoverColor?: string

  /**
   * @see https://echarts.apache.org/option.html#series-pie.padAngle
   */
  padAngle?: number
}

EcOptions

ts
export type EcOptions = Partial<EChartsOption>

基于 MIT 许可发布