feat: support customize title

This commit is contained in:
vicanso 2022-01-01 20:11:51 +08:00
parent 06c326bdc3
commit 25e9984ad8
8 changed files with 167 additions and 7 deletions

View file

@ -194,7 +194,10 @@ func newPieChart(opt Options) *chart.PieChart {
if opt.Title.Left == "" {
opt.Title.Left = "center"
}
titleRender := newTitleRenderable(opt.Title, p.GetFont(), p.GetColorPalette().TextColor())
themeColorPalette := &ThemeColorPalette{
Theme: opt.Theme,
}
titleRender := newTitleRenderable(opt.Title, p.GetFont(), themeColorPalette.TextColor())
if titleRender != nil {
p.Elements = []chart.Renderable{
titleRender,