| 1 | package opts |
| 2 | |
| 3 | import "github.com/go-echarts/go-echarts/v2/types" |
| 4 | |
| 5 | // XAxis3D contains options for X axis in the 3D coordinate. |
| 6 | type XAxis3D struct { |
| 7 | // Whether to display the x-axis. |
| 8 | Show types.Bool `json:"show,omitempty"` |
| 9 | |
| 10 | // The name of the axis. |
| 11 | Name string `json:"name,omitempty"` |
| 12 | |
| 13 | // The index of the grid3D component used by the axis. The default is to use the first grid3D component. |
| 14 | Grid3DIndex int `json:"grid3DIndex,omitempty"` |
| 15 | |
| 16 | // The type of the axis. |
| 17 | // Optional: |
| 18 | // * 'value' The value axis. Suitable for continuous data. |
| 19 | // * 'category' The category axis. Suitable for the discrete category data. |
| 20 | // For this type, the category data must be set through data. |
| 21 | // * 'time' The timeline. Suitable for the continuous timing data. The time axis has a |
| 22 | // time format compared to the value axis, and the scale calculation is also different. |
| 23 | // For example, the scale of the month, week, day, and hour ranges can be determined according to the range of the span. |
| 24 | // * 'log' Logarithmic axis. Suitable for the logarithmic data. |
| 25 | Type string `json:"type,omitempty"` |
| 26 | |
| 27 | // The minimum value of axis. |
| 28 | // It can be set to a special value 'dataMin' so that the minimum value on this axis is set to be the minimum label. |
| 29 | // It will be automatically computed to make sure the axis tick is equally distributed when not set. |
| 30 | // In the category axis, it can also be set as the ordinal number. For example, |
| 31 | // if a category axis has data: ['categoryA', 'categoryB', 'categoryC'], |
| 32 | // and the ordinal 2 represents 'categoryC'. Moreover, it can be set as a negative number, like -3. |
| 33 | Min interface{} `json:"min,omitempty"` |
| 34 | |
| 35 | // The maximum value of the axis. |
| 36 | // It can be set to a special value 'dataMax' so that the minimum value on this axis is set to be the maximum label. |
| 37 | // It will be automatically computed to make sure the axis tick is equally distributed when not set. |
| 38 | // In the category axis, it can also be set as the ordinal number. For example, if a category axis |
| 39 | // has data: ['categoryA', 'categoryB', 'categoryC'], and the ordinal 2 represents 'categoryC'. |
| 40 | // Moreover, it can be set as a negative number, like -3. |
| 41 | Max interface{} `json:"max,omitempty"` |
| 42 | |
| 43 | // Category data, available in type: 'category' axis. |
| 44 | // If type is specified as 'category', but axis.data is not specified, axis.data will be auto |
| 45 | // collected from series.data. It brings convenience, but we should notice that axis.data provides |
| 46 | // then value range of the 'category' axis. If it is auto collected from series.data, |
| 47 | // Only the values appearing in series.data can be collected. For example, |
| 48 | // if series.data is empty, nothing will be collected. |
| 49 | Data interface{} `json:"data,omitempty"` |
| 50 | } |
| 51 | |
| 52 | // YAxis3D contains options for Y axis in the 3D coordinate. |
| 53 | type YAxis3D struct { |
| 54 | // Whether to display the y-axis. |
| 55 | Show types.Bool `json:"show,omitempty"` |
| 56 | |
| 57 | // The name of the axis. |
| 58 | Name string `json:"name,omitempty"` |
| 59 | |
| 60 | // The index of the grid3D component used by the axis. The default is to use the first grid3D component. |
| 61 | Grid3DIndex int `json:"grid3DIndex,omitempty"` |
| 62 | |
| 63 | // The type of the axis. |
| 64 | // Optional: |
| 65 | // * 'value' The value axis. Suitable for continuous data. |
| 66 | // * 'category' The category axis. Suitable for the discrete category data. |
| 67 | // For this type, the category data must be set through data. |
| 68 | // * 'time' The timeline. Suitable for the continuous timing data. The time axis has a |
| 69 | // time format compared to the value axis, and the scale calculation is also different. |
| 70 | // For example, the scale of the month, week, day, and hour ranges can be determined according to the range of the span. |
| 71 | // * 'log' Logarithmic axis. Suitable for the logarithmic data. |
| 72 | Type string `json:"type,omitempty"` |
| 73 | |
| 74 | // The minimum value of axis. |
| 75 | // It can be set to a special value 'dataMin' so that the minimum value on this axis is set to be the minimum label. |
| 76 | // It will be automatically computed to make sure the axis tick is equally distributed when not set. |
| 77 | // In the category axis, it can also be set as the ordinal number. For example, |
| 78 | // if a category axis has data: ['categoryA', 'categoryB', 'categoryC'], |
| 79 | // and the ordinal 2 represents 'categoryC'. Moreover, it can be set as a negative number, like -3. |
| 80 | Min interface{} `json:"min,omitempty"` |
| 81 | |
| 82 | // The maximum value of the axis. |
| 83 | // It can be set to a special value 'dataMax' so that the minimum value on this axis is set to be the maximum label. |
| 84 | // It will be automatically computed to make sure the axis tick is equally distributed when not set. |
| 85 | // In the category axis, it can also be set as the ordinal number. For example, if a category axis |
| 86 | // has data: ['categoryA', 'categoryB', 'categoryC'], and the ordinal 2 represents 'categoryC'. |
| 87 | // Moreover, it can be set as a negative number, like -3. |
| 88 | Max interface{} `json:"max,omitempty"` |
| 89 | |
| 90 | // Category data, available in type: 'category' axis. |
| 91 | // If type is specified as 'category', but axis.data is not specified, axis.data will be auto |
| 92 | // collected from series.data. It brings convenience, but we should notice that axis.data provides |
| 93 | // then value range of the 'category' axis. If it is auto collected from series.data, |
| 94 | // Only the values appearing in series.data can be collected. For example, |
| 95 | // if series.data is empty, nothing will be collected. |
| 96 | Data interface{} `json:"data,omitempty"` |
| 97 | } |
| 98 | |
| 99 | // ZAxis3D contains options for Z axis in the 3D coordinate. |
| 100 | type ZAxis3D struct { |
| 101 | // Whether to display the z-axis. |
| 102 | Show types.Bool `json:"show,omitempty"` |
| 103 | |
| 104 | // The name of the axis. |
| 105 | Name string `json:"name,omitempty"` |
| 106 | |
| 107 | // The index of the grid3D component used by the axis. The default is to use the first grid3D component. |
| 108 | Grid3DIndex int `json:"grid3DIndex,omitempty"` |
| 109 | |
| 110 | // The type of the axis. |
| 111 | // Optional: |
| 112 | // * 'value' The value axis. Suitable for continuous data. |
| 113 | // * 'category' The category axis. Suitable for the discrete category data. |
| 114 | // For this type, the category data must be set through data. |
| 115 | // * 'time' The timeline. Suitable for the continuous timing data. The time axis has a |
| 116 | // time format compared to the value axis, and the scale calculation is also different. |
| 117 | // For example, the scale of the month, week, day, and hour ranges can be determined according to the range of the span. |
| 118 | // * 'log' Logarithmic axis. Suitable for the logarithmic data. |
| 119 | Type string `json:"type,omitempty"` |
| 120 | |
| 121 | // The minimum value of axis. |
| 122 | // It can be set to a special value 'dataMin' so that the minimum value on this axis is set to be the minimum label. |
| 123 | // It will be automatically computed to make sure the axis tick is equally distributed when not set. |
| 124 | // In the category axis, it can also be set as the ordinal number. For example, |
| 125 | // if a category axis has data: ['categoryA', 'categoryB', 'categoryC'], |
| 126 | // and the ordinal 2 represents 'categoryC'. Moreover, it can be set as a negative number, like -3. |
| 127 | Min interface{} `json:"min,omitempty"` |
| 128 | |
| 129 | // The maximum value of the axis. |
| 130 | // It can be set to a special value 'dataMax' so that the minimum value on this axis is set to be the maximum label. |
| 131 | // It will be automatically computed to make sure the axis tick is equally distributed when not set. |
| 132 | // In the category axis, it can also be set as the ordinal number. For example, if a category axis |
| 133 | // has data: ['categoryA', 'categoryB', 'categoryC'], and the ordinal 2 represents 'categoryC'. |
| 134 | // Moreover, it can be set as a negative number, like -3. |
| 135 | Max interface{} `json:"max,omitempty"` |
| 136 | |
| 137 | // Category data, available in type: 'category' axis. |
| 138 | // If type is specified as 'category', but axis.data is not specified, axis.data will be auto |
| 139 | // collected from series.data. It brings convenience, but we should notice that axis.data provides |
| 140 | // then value range of the 'category' axis. If it is auto collected from series.data, |
| 141 | // Only the values appearing in series.data can be collected. For example, |
| 142 | // if series.data is empty, nothing will be collected. |
| 143 | Data interface{} `json:"data,omitempty"` |
| 144 | } |
| 145 | |
| 146 | // Grid3D contains options for the 3D coordinate. |
| 147 | type Grid3D struct { |
| 148 | // Whether to show the coordinate. |
| 149 | Show types.Bool `json:"show,omitempty"` |
| 150 | |
| 151 | // 3D Cartesian coordinates width |
| 152 | // default 100 |
| 153 | BoxWidth float32 `json:"boxWidth,omitempty"` |
| 154 | |
| 155 | // 3D Cartesian coordinates height |
| 156 | // default 100 |
| 157 | BoxHeight float32 `json:"boxHeight,omitempty"` |
| 158 | |
| 159 | // 3D Cartesian coordinates depth |
| 160 | // default 100 |
| 161 | BoxDepth float32 `json:"boxDepth,omitempty"` |
| 162 | |
| 163 | // Rotate or scale fellows the mouse |
| 164 | ViewControl *ViewControl `json:"viewControl,omitempty"` |
| 165 | } |
| 166 | |
| 167 | // ViewControl contains options for view controlling. |
| 168 | type ViewControl struct { |
| 169 | // Whether to rotate automatically. |
| 170 | AutoRotate types.Bool `json:"autoRotate,omitempty"` |
| 171 | |
| 172 | // Rotate Speed, (angle/s). |
| 173 | // default 10 |
| 174 | AutoRotateSpeed float32 `json:"autoRotateSpeed,omitempty"` |
| 175 | } |