feat: support option function for chart render
This commit is contained in:
parent
1be8d43405
commit
2316689ce5
5 changed files with 429 additions and 3 deletions
5
chart.go
5
chart.go
|
|
@ -283,7 +283,10 @@ func (r *basicRenderResult) getYRange(index int) *Range {
|
|||
}
|
||||
|
||||
// Render renders the chart by option
|
||||
func Render(opt ChartOption) (*Draw, error) {
|
||||
func Render(opt ChartOption, optFuncs ...OptionFunc) (*Draw, error) {
|
||||
for _, optFunc := range optFuncs {
|
||||
optFunc(&opt)
|
||||
}
|
||||
if len(opt.SeriesList) == 0 {
|
||||
return nil, errors.New("series can not be nil")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue