feat: support echart options

This commit is contained in:
vicanso 2022-02-16 22:51:02 +08:00
parent b934b853a9
commit 519c8a492e
8 changed files with 803 additions and 2 deletions

View file

@ -25,6 +25,7 @@ package charts
import (
"errors"
"math"
"strings"
"github.com/golang/freetype/truetype"
"github.com/wcharczuk/go-chart/v2"
@ -155,6 +156,10 @@ func (o *ChartOption) FillDefault(theme string) {
}
}
}
// 如果无legend数据则隐藏
if len(strings.Join(o.Legend.Data, "")) == 0 {
o.Legend.Show = FalseFlag()
}
if o.Legend.Style.Font == nil {
o.Legend.Style.Font = o.Font
}