feat: support multi y axis
This commit is contained in:
parent
ead48fef8e
commit
23e2eca0c6
6 changed files with 62 additions and 61 deletions
15
series.go
15
series.go
|
|
@ -32,11 +32,11 @@ type SeriesData struct {
|
|||
}
|
||||
|
||||
type Series struct {
|
||||
Type string
|
||||
Name string
|
||||
Data []SeriesData
|
||||
XValues []float64
|
||||
YAxis chart.YAxisType
|
||||
Type string
|
||||
Name string
|
||||
Data []SeriesData
|
||||
XValues []float64
|
||||
YAxisIndex int
|
||||
}
|
||||
|
||||
const lineStrokeWidth = 2
|
||||
|
|
@ -103,7 +103,10 @@ func GetSeries(series []Series, tickPosition chart.TickPosition, theme string) [
|
|||
Style: style,
|
||||
YValues: yValues,
|
||||
TickPosition: tickPosition,
|
||||
YAxis: item.YAxis,
|
||||
YAxis: chart.YAxisSecondary,
|
||||
}
|
||||
if item.YAxisIndex != 0 {
|
||||
baseSeries.YAxis = chart.YAxisPrimary
|
||||
}
|
||||
// TODO 判断类型
|
||||
switch item.Type {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue