Doughnut & Pie Examples
Pie and doughnut charts are excellent at showing the relational proportions between data. They are effectively the same class in Chart.js, but have one different default value - their cutout. Default Arc border length and spacing of dashes. External Link Arc border offset for line dashes. Default Arc border join style. External Link Set Data for arc chart. Arc border length and spacing of dashes when hovered. External Link Arc border offset for line dashes when hovered. External Link Arc border join style when hovered. External Link Per-dataset override for the sweep that the arcs cover. Arc offset when hovered (in pixels). Default Arc offset (in pixels). Default Arc offset (in pixels). (multiple) Per-dataset override for the starting angle to draw arcs from. Fixed arc offset (in pixels). Similar to offset but applies to all arcs. Default The relative thickness of the dataset. Providing a value for weight will cause the pie or doughnut dataset to be drawn with a thickness relative to the sum of all the dataset weight values. Default <RzChart Configure=@(c => c
.Data(d => d
.Labels("Red", "Blue", "Yellow")
.Datasets(ds => ds
.Doughnut()
.Label("Doughnut Dataset")
.Data(300, 50, 100)
.BackgroundColors("var(--chart-1)", "var(--chart-2)", "var(--chart-3)")
.HoverOffset(4)
)
)
.Options(o => o
.Responsive(true)
.MaintainAspectRatio(false)
.Plugins(p => p.Title(t => t.Display(true).Text("Chart.js Doughnut Chart")))
)) /><RzChart Configure=@(c => c
.Data(d => d
.Labels("Red", "Blue", "Yellow")
.Datasets(ds => ds
.Pie()
.Label("Pie Dataset")
.Data(300, 50, 100)
.BackgroundColors("var(--chart-1)", "var(--chart-2)", "var(--chart-3)")
.HoverOffset(4)
)
)
.Options(o => o
.Responsive(true)
.MaintainAspectRatio(false)
.Plugins(p => p.Title(t => t.Display(true).Text("Chart.js Pie Chart")))
)) />Arc Dataset Options
BorderAlign
'center'.BorderAlign(BorderAlign.Inner)BorderDash
.BorderDash(15, 3, 3, 3)BorderDashOffset
0.0 External Link.BorderDashOffset(0.1)BorderJoinStyle
.BorderJoinStyle(JoinStyle.Bevel)Data
.Data(3, 5, 2, 4)HoverBorderDash
.HoverBorderDash(15, 3, 3, 3)HoverBorderDashOffset
.HoverBorderDashOffset(0.1)HoverBorderJoinStyle
.HoverBorderJoinStyle(JoinStyle.Bevel)Dougnut&Pie Dataset Options
Circumference
.Circumference(2)HoverOffset
0.HoverOffset(1)Offset
0.Offset(1).Offset(1, 2)Rotation
.Rotation(1)Spacing
0.Spacing(1)Weight
1.Weight(2)