feat: support echart options
This commit is contained in:
parent
b934b853a9
commit
519c8a492e
8 changed files with 803 additions and 2 deletions
5
chart.go
5
chart.go
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue