# 接口:饼图控制器数据集选项
# 继承层次结构
ScriptableAndArrayOptions<ArcOptions,ScriptableContext<"doughnut">>ScriptableAndArrayOptions<ArcHoverOptions,ScriptableContext<"doughnut">>AnimationOptions<"doughnut">↳
DoughnutControllerDatasetOptions
# 属性
# 动画
• animation: false | AnimationSpec<"doughnut"> & { onComplete?: (this: Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint][], unknown>, event: AnimationEvent) => void ; onProgress?: (this: Chart<keyof ChartTypeRegistry, (number | [number, number] | Point | BubbleDataPoint][], unknown>, event: AnimationEvent) => void }
# 继承自
AnimationOptions.animation
# 定义于
types/index.d.ts:1747 (opens new window)
# 动画
• animations: AnimationsSpec<"doughnut">
# 继承自
AnimationOptions.animations
# 定义于
types/index.d.ts:1757 (opens new window)
# 背景颜色
• backgroundColor: ScriptableAndArray<Color, ScriptableContext<"doughnut">>
# 继承自
ScriptableAndArrayOptions.backgroundColor
# 定义于
types/index.d.ts:1807 (opens new window)
# borderAlign
• borderAlign: ScriptableAndArray<"center" | "inner", ScriptableContext<"doughnut">>
弧线填充对齐。
# 继承自
ScriptableAndArrayOptions.borderAlign
# 定义于
# borderColor
• borderColor: ScriptableAndArray<Color, ScriptableContext<"doughnut">>
# 继承自
ScriptableAndArrayOptions.borderColor
# 定义于
# borderDash
• borderDash: ScriptableAndArray<number[], ScriptableContext<"doughnut">>
线段划线。参考MDN。
默认值
[]
# 继承自
ScriptableAndArrayOptions.borderDash
# 定义于
# borderDashOffset
• borderDashOffset: ScriptableAndArray<number, ScriptableContext<"doughnut">>
线段划线偏移量。参考MDN。
默认值
0.0
# 继承自
ScriptableAndArrayOptions.borderDashOffset
# 定义于
# borderJoinStyle
• borderJoinStyle: ScriptableAndArray<CanvasLineJoin, ScriptableContext<"doughnut">>
线连接样式。参考MDN。当borderAlign为'inner'时默认为'round',否则为'bevel'。
# 继承自
ScriptableAndArrayOptions.borderJoinStyle
# 定义于
# borderRadius
• borderRadius: ScriptableAndArray<number | ArcBorderRadius, ScriptableContext<"doughnut">>
设置圆弧的边框半径
默认值
0
# 继承自
ScriptableAndArrayOptions.borderRadius
# 定义在
types/index.d.ts:1853 (在新窗口中打开)
# borderWidth
• borderWidth: ScriptableAndArray<number, ScriptableContext<"doughnut">>
# 继承自
ScriptableAndArrayOptions.borderWidth
# 定义在
types/index.d.ts:1805 (在新窗口中打开)
# circular
• circular: ScriptableAndArray<boolean, ScriptableContext<"doughnut">>
如果为false,则Arc将为平面。
默认值
是
# 继承自
ScriptableAndArrayOptions.circular
# 定义在
types/index.d.ts:1864 (在新窗口中打开)
# circumference
• circumference: number
允许弧覆盖的范围。
默认值
360
# 定义在
types/index.d.ts:257 (在新窗口中打开)
# clip
• clip: number | false | ChartArea
相对于图表区域的剪切方式。正值允许溢出,负值剪切图表区域内的像素。0 = 剪切在图表区域。也可以为每边配置剪切:clip: {left: 5, top: false, right: -2, bottom: 0}
# 继承自
# 定义在
# hidden
• hidden: boolean
配置数据集的可见状态。将其设置为true,以在图表中隐藏数据集。
默认值
false
# 继承自
ControllerDatasetOptions.hidden
# 定义在
# hoverBackgroundColor
• hoverBackgroundColor: ScriptableAndArray<Color, ScriptableContext<"doughnut">>
# 继承自
ScriptableAndArrayOptions.hoverBackgroundColor
# 定义在
# hoverBorderColor
• hoverBorderColor: ScriptableAndArray<Color, ScriptableContext<"doughnut">>
# 继承自
ScriptableAndArrayOptions.hoverBorderColor
# 定义在
# hoverBorderDash
• hoverBorderDash: ScriptableAndArray<number[], ScriptableContext<"doughnut">>
# 继承自
ScriptableAndArrayOptions.hoverBorderDash
# 定义在
# hoverBorderDashOffset
• hoverBorderDashOffset: ScriptableAndArray<number, ScriptableContext<"doughnut">>
# 继承自
ScriptableAndArrayOptions.hoverBorderDashOffset
# 定义在
# hoverBorderWidth
• hoverBorderWidth: ScriptableAndArray<number, ScriptableContext<"doughnut">>
# 封裝自
ScriptableAndArrayOptions.hoverBorderWidth
# 定義在
types/index.d.ts:1811 (在新窗口中打开)
# hoverOffset
• hoverOffset: ScriptableAndArray<number, ScriptableContext<"doughnut">>
# 封裝自
ScriptableAndArrayOptions.hoverOffset
# 定義在
types/index.d.ts:1875 (在新窗口中打开)
# indexAxis
• indexAxis: "x" | "y"
图表的基础坐标轴。'x' 适用于垂直图表,'y' 适用于水平图表。
默认值
'x'
# 封裝自
ControllerDatasetOptions.indexAxis
# 定義在
# label
• label: string
数据集的标签,会在图例和工具提示中显示。
# 封裝自
ControllerDatasetOptions.label
# 定義在
# normalized
• normalized: boolean
如果提供的数据具有唯一、排序良好且在各数据集中一致的索引,并且提供了 normalized: true 选项以告诉 Chart.js 你已经这样做了,则 Chart.js 运行最快。
# 封裝自
ControllerDatasetOptions.normalized
# 定義在
# offset
• offset: number | number[]
弧偏移量(以像素为单位)。
# 覆盖
ScriptableAndArrayOptions.offset
# 定義在
types/index.d.ts:262 (在新的窗口中打开)
# order
• order: number
数据集的绘制顺序。也会影响到堆叠、工具提示和图例的顺序。
# 继承自
ControllerDatasetOptions.order
# 定义在
types/index.d.ts:83 (在新的窗口中打开)
# parsing
• parsing: false | { [key: string]: string; }
如何解析数据集。可以通过在图表选项或数据集中指定parsing: false来禁用解析。如果禁用解析,数据必须排序,并且符合相关图表类型和尺度内部使用的格式。
# 继承自
ControllerDatasetOptions.parsing
# 定义在
types/index.d.ts:54 (在新的窗口中打开)
# rotation
• rotation: number
从该角度开始绘制数据集。
默认值
0
# 定义在
types/index.d.ts:268 (在新的窗口中打开)
# spacing
• spacing: number
与offset选项类似,但应用于所有弧。这可以用于在弧之间添加空间
默认值
0
# 覆盖
ScriptableAndArrayOptions.spacing
# 定义在
types/index.d.ts:281 (在新的窗口中打开)
# stack
• stack: string
此数据集所属的组的ID(当堆叠时,每个组将是一个独立的堆叠)。
# 继承自
ControllerDatasetOptions.stack
# 定义在
# transitions
• transitions: TransitionsSpec<"doughnut">
# 继承自
AnimationOptions.transitions
# 定义于
types/index.d.ts:1758 (在新窗口中打开)
# weight
• weight: number
数据集的相关厚度。提供weight值将导致饼图或环形图数据集相对于所有数据集weight值的总和以厚度绘制。
默认值
1