import { Graph, IPoint } from "./core"; import { Sector } from "./circle"; import Text from "./text"; export type RingItem = number | { label?: string; value: number; color?: string; }; export type RingOptions = { /** * 圆心 */ o: IPoint; /** * 半径 */ r: number; /** * 环宽度 */ width: number; /** * 绘制环 * @param graph * @param item * @param index */ render?: (graph: Sector | Text, item: RingItem, index: number) => void; /** * 填充色 按顺序获取 */ colors?: string[]; /** * 显示数据 */ items?: Array; }; export default class Ring extends Graph { private readonly optional; private readonly colors; private readonly items; constructor(optional: RingOptions); addItem(item: RingItem): this; draw(): SVGElement; }