feat: support multi y axis
This commit is contained in:
parent
ead48fef8e
commit
23e2eca0c6
6 changed files with 62 additions and 61 deletions
15
charts.go
15
charts.go
|
|
@ -58,6 +58,7 @@ type (
|
|||
Title Title
|
||||
Legend Legend
|
||||
TickPosition chart.TickPosition
|
||||
Log chart.Logger
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -142,16 +143,20 @@ func New(opt Options) (Graph, error) {
|
|||
}
|
||||
}
|
||||
|
||||
var yAxisOption *YAxisOption
|
||||
if len(opt.YAxisOptions) != 0 {
|
||||
yAxisOption = opt.YAxisOptions[0]
|
||||
}
|
||||
var secondaryYAxisOption *YAxisOption
|
||||
if len(opt.YAxisOptions) != 0 {
|
||||
secondaryYAxisOption = opt.YAxisOptions[0]
|
||||
}
|
||||
|
||||
yAxisOption := &YAxisOption{
|
||||
Disabled: true,
|
||||
}
|
||||
if len(opt.YAxisOptions) > 1 {
|
||||
secondaryYAxisOption = opt.YAxisOptions[1]
|
||||
yAxisOption = opt.YAxisOptions[1]
|
||||
}
|
||||
|
||||
g := &chart.Chart{
|
||||
Log: opt.Log,
|
||||
ColorPalette: &ThemeColorPalette{
|
||||
Theme: opt.Theme,
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue