Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions examples/pie.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,36 @@
return pie
}

func pieRadiusWithPadAngle() *charts.Pie {
pie := charts.NewPie()
pie.SetGlobalOptions(
charts.WithTitleOpts(opts.Title{Title: "Radius style with padAngle"}),
charts.WithTooltipOpts(opts.Tooltip{
Show: opts.Bool(true),
Formatter: "{b}: {d}%",
}),
charts.WithLegendOpts(opts.Legend{
Orient: "vertical",
Right: "20%",
Top: "center",
Padding: []any{1, 1, 1, 1},
}),
)

pie.AddSeries("pie", generatePieItems()).
SetSeriesOptions(
charts.WithLabelOpts(opts.Label{
Show: opts.Bool(false),
}),
charts.WithPieChartOpts(opts.PieChart{
Radius: []string{"40%", "75%"},
Center: []string{"40%", "50%"},
PadAngle: 5,

Check failure on line 95 in examples/pie.go

View workflow job for this annotation

GitHub Actions / build

unknown field 'PadAngle' in struct literal of type opts.PieChart
}),
)
return pie
}

func pieRoseArea() *charts.Pie {
pie := charts.NewPie()
pie.SetGlobalOptions(
Expand Down Expand Up @@ -242,10 +272,12 @@

func (PieExamples) Examples() {
page := components.NewPage()
page.AssetsHost = "https://cdn.jsdelivr.net/npm/echarts@5.6.0/dist/"
page.AddCharts(
pieBase(),
pieShowLabel(),
pieRadius(),
pieRadiusWithPadAngle(),
pieRoseArea(),
pieRoseRadius(),
pieRoseAreaRadius(),
Expand Down
Loading