-
Notifications
You must be signed in to change notification settings - Fork 547
/
y_axis.go
97 lines (78 loc) 路 3.67 KB
/
y_axis.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
package opts
import "github.com/go-echarts/go-echarts/v2/types"
// YAxis is the option set for Y axis.
// https://echarts.apache.org/en/option.html#yAxis
type YAxis struct {
// Name of axis.
Name string `json:"name,omitempty"`
// Location of axis name.
//
// Options:
// 'start'
// 'middle' or 'center'
// 'end'
NameLocation string `json:"nameLocation,omitempty"`
// Gap between axis name and axis line.
NameGap int `json:"nameGap,omitempty"`
// Type of axis.
// Option:
// * 'value': Numerical axis, suitable for continuous data.
// * 'category': Category axis, suitable for discrete category data.
// Category data can be auto retrieved from series.data or dataset.source,
// or can be specified via xAxis.data.
// * 'time' Time axis, suitable for continuous time series data. As compared to value axis,
// it has a better formatting for time and a different tick calculation method. For example,
// it decides to use month, week, day or hour for tick based on the range of span.
// * 'log' Log axis, suitable for log data.
Type string `json:"type,omitempty"`
// Set this to false to prevent the axis from showing.
Show types.Bool `json:"show,omitempty"`
// Category data, available in type: 'category' axis.
Data interface{} `json:"data,omitempty"`
// Number of segments that the axis is split into. Note that this number serves only as a
// recommendation, and the true segments may be adjusted based on readability.
// This is unavailable for category axis.
SplitNumber int `json:"splitNumber,omitempty"`
// It is available only in numerical axis, i.e., type: 'value'.
// It specifies whether not to contain zero position of axis compulsively.
// When it is set to be true, the axis may not contain zero position,
// which is useful in the scatter chart for both value axes.
// This configuration item is unavailable when the min and max are set.
Scale types.Bool `json:"scale,omitempty"`
// The minimum value of axis.
// It can be set to a special value 'dataMin' so that the minimum value on this axis is set to be the minimum label.
// It will be automatically computed to make sure axis tick is equally distributed when not set.
Min interface{} `json:"min,omitempty"`
// The maximum value of axis.
// It can be set to a special value 'dataMax' so that the minimum value on this axis is set to be the maximum label.
// It will be automatically computed to make sure axis tick is equally distributed when not set.
Max interface{} `json:"max,omitempty"`
// Minimum gap between split lines.
//
// For example, it can be set to be 1 to make sure axis label is show as integer.
// {
// minInterval: 1
// }
// It is available only for axis of type 'value' or 'time'.
MinInterval float64 `json:"minInterval,omitempty"`
// Maximum gap between split lines.
// For example, in time axis (type is 'time'), it can be set to be 3600 * 24 * 1000 to make sure that the gap between axis labels is less than or equal to one day.
//{
// maxInterval: 3600 * 1000 * 24
//}
// It is available only for axis of type 'value' or 'time'.
MaxInterval float64 `json:"maxInterval,omitempty"`
// The index of grid which the Y axis belongs to. Defaults to be in the first grid.
// default 0
GridIndex int `json:"gridIndex,omitempty"`
// Split area of Y axis in grid area.
SplitArea *SplitArea `json:"splitArea,omitempty"`
// Split line of Y axis in grid area.
SplitLine *SplitLine `json:"splitLine,omitempty"`
// Settings related to axis label.
AxisLabel *AxisLabel `json:"axisLabel,omitempty"`
// Settings related to axis line.
AxisLine *AxisLine `json:"axisLine,omitempty"`
// Settings related to axis pointer.
AxisPointer *AxisPointer `json:"axisPointer,omitempty"`
}