test: add test for series
This commit is contained in:
parent
1c89ed29be
commit
51682069d7
7 changed files with 370 additions and 18 deletions
11
bar_chart.go
11
bar_chart.go
|
|
@ -23,10 +23,17 @@
|
|||
package charts
|
||||
|
||||
import (
|
||||
"github.com/golang/freetype/truetype"
|
||||
"github.com/wcharczuk/go-chart/v2"
|
||||
)
|
||||
|
||||
func barChartRender(opt ChartOption, result *basicRenderResult) ([]*markPointRenderOption, error) {
|
||||
type barChartOption struct {
|
||||
SeriesList SeriesList
|
||||
Theme string
|
||||
Font *truetype.Font
|
||||
}
|
||||
|
||||
func barChartRender(opt barChartOption, result *basicRenderResult) ([]*markPointRenderOption, error) {
|
||||
|
||||
d, err := NewDraw(DrawOption{
|
||||
Parent: result.d,
|
||||
|
|
@ -56,7 +63,7 @@ func barChartRender(opt ChartOption, result *basicRenderResult) ([]*markPointRen
|
|||
barMaxHeight := result.getYRange(0).Size
|
||||
theme := NewTheme(opt.Theme)
|
||||
|
||||
seriesNames := opt.Legend.Data
|
||||
seriesNames := opt.SeriesList.Names()
|
||||
|
||||
r := d.Render
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue