Skip to content

Commit

Permalink
fix: fix opts.Polar config support in charts (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koooooo-7 committed May 9, 2024
1 parent 6e5c28f commit 48b021d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions charts/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ func WithBrush(opt opts.Brush) GlobalOpts {
func WithPolarOps(opt opts.Polar) GlobalOpts {
return func(bc *BaseConfiguration) {
bc.Polar = opt
bc.hasPolar = true
bc.hasXYAxis = false
}
}

Expand Down
4 changes: 2 additions & 2 deletions opts/charts.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,10 @@ type LineData struct {
SymbolSize int `json:"symbolSize,omitempty"`

// Index of x axis to combine with, which is useful for multiple x axes in one chart.
XAxisIndex int
XAxisIndex int `json:"XAxisIndex,omitempty"`

// Index of y axis to combine with, which is useful for multiple y axes in one chart.
YAxisIndex int
YAxisIndex int `json:"YAxisIndex,omitempty"`
}

// LiquidChart
Expand Down
4 changes: 2 additions & 2 deletions opts/polar.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ type Polar struct {
// center: [400, 300]
// Set to relative percent
// center: ['50%', '50%']
Center [2]string `json:"center,omitempty"`
Center []string `json:"center,omitempty"`

// Radius of Polar coordinate. Value can be:
Radius [2]string `json:"radius,omitempty"`
Radius []string `json:"radius,omitempty"`

// Tooltip settings in the coordinate system component.
Tooltip Tooltip `json:"tooltip,omitempty"`
Expand Down

0 comments on commit 48b021d

Please sign in to comment.