Skip to content

Commit

Permalink
update: opts polar radius_axis (#363)
Browse files Browse the repository at this point in the history
  • Loading branch information
Koooooo-7 committed Jan 23, 2024
1 parent 8a6d35e commit 0bdecc8
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 20 deletions.
50 changes: 36 additions & 14 deletions opts/polar.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,41 @@ type Polar struct {
}

type PolarAxisBase struct {
ID string `json:"id,omitempty"`
PolarIndex int `json:"polarIndex,omitempty"`
StartAngle float64 `json:"startAngle,omitempty"`
Type string `json:"type,omitempty"`
BoundaryGap types.Bool `json:"boundaryGap,omitempty"`
Min float64 `json:"min,omitempty"`
Max float64 `json:"max,omitempty"`
Scale types.Bool `json:"scale,omitempty"`
SplitNumber int `json:"splitNumber,omitempty"`
MinInterval float64 `json:"minInterval,omitempty"`
MaxInterval float64 `json:"maxInterval,omitempty"`
Interval float64 `json:"interval,omitempty"`
LogBase float64 `json:"logBase,omitempty"`
Silent types.Bool `json:"silent,omitempty"`
ID string `json:"id,omitempty"`
// PolarIndex Index of radial axis in polar coordinate. It's the first axis by default.
PolarIndex int `json:"polarIndex,omitempty"`
// Type of axis.
//Option:
// 'value' Numerical axis, suitable for continuous data.
// 'category' Category axis, suitable for discrete category data.
// 'time' Time axis, suitable for continuous time series data.
// 'log' Log axis, suitable for log data.
Type string `json:"type,omitempty"`
StartAngle float64 `json:"startAngle,omitempty"`
BoundaryGap types.Bool `json:"boundaryGap,omitempty"`
Min float64 `json:"min,omitempty"`
Max float64 `json:"max,omitempty"`
Scale types.Bool `json:"scale,omitempty"`
SplitNumber int `json:"splitNumber,omitempty"`
MinInterval float64 `json:"minInterval,omitempty"`
MaxInterval float64 `json:"maxInterval,omitempty"`
Interval float64 `json:"interval,omitempty"`
// LogBase Base of logarithm, which is valid only for numeric axes with type: 'log'.
LogBase float64 `json:"logBase,omitempty"`
// Silent Set this to true, to prevent interaction with the axis.
Silent types.Bool `json:"silent,omitempty"`
// TriggerEvent Set this to true to enable triggering events.
// Parameters of the event include:
//{
// // Component type: xAxis, yAxis, radiusAxis, angleAxis
// // Each of which has an attribute for index, e.g., xAxisIndex for xAxis
// componentType: string,
// // Value on axis before being formatted.
// // Click on value label to trigger event.
// value: '',
// // Name of axis.
// // Click on laben name to trigger event.
// name: ''
//}
TriggerEvent types.Bool `json:"triggerEvent,omitempty"`
}
26 changes: 20 additions & 6 deletions opts/radius_axis.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,24 @@ import "github.com/go-echarts/go-echarts/v2/types"

type RadiusAxis struct {
PolarAxisBase
Name string `json:"name,omitempty"`
NameLocation string `json:"nameLocation,omitempty"`
NameTextStyle TextStyle `json:"nameTextStyle,omitempty"`
NameGap float64 `json:"nameGap,omitempty"`
NameRadius float64 `json:"nameRotate,omitempty"`
Inverse types.Bool `json:"inverse,omitempty"`

Name string `json:"name,omitempty"`
// NameLocation Location of axis name.
// Options:
// 'start'
// 'middle' or 'center'
// 'end'
NameLocation string `json:"nameLocation,omitempty"`

// NameTextStyle Text style of axis name.
NameTextStyle TextStyle `json:"nameTextStyle,omitempty"`

// NameGap Gap between axis name and axis line.
NameGap float64 `json:"nameGap,omitempty"`

// NameRadius Rotation of axis name.
NameRadius float64 `json:"nameRotate,omitempty"`

// Inverse Set this to true to invert the axis. This is a new option available from Echarts 3 and newer.
Inverse types.Bool `json:"inverse,omitempty"`
}

0 comments on commit 0bdecc8

Please sign in to comment.