| 1 | package opts |
| 2 | |
| 3 | import "github.com/go-echarts/go-echarts/v2/types" |
| 4 | |
| 5 | // Title is the option set for a title component. |
| 6 | // https://echarts.apache.org/en/option.html#title |
| 7 | type Title struct { |
| 8 | // Set this to false to prevent the title from showing |
| 9 | Show types.Bool `json:"show,omitempty"` |
| 10 | |
| 11 | // The main title text, supporting \n for newlines. |
| 12 | Title string `json:"text,omitempty"` |
| 13 | |
| 14 | // The hyper link of main title text. |
| 15 | Link string `json:"link,omitempty"` |
| 16 | |
| 17 | // Open the hyper link of main title in specified tab. |
| 18 | // options: |
| 19 | // 'self' opening it in current tab |
| 20 | // 'blank' opening it in a new tab |
| 21 | Target string `json:"target,omitempty"` |
| 22 | |
| 23 | // TextStyle of the main title. |
| 24 | TitleStyle *TextStyle `json:"textStyle,omitempty"` |
| 25 | |
| 26 | // Subtitle text, supporting \n for newlines. |
| 27 | Subtitle string `json:"subtext,omitempty"` |
| 28 | |
| 29 | // The hyper link of sub title text. |
| 30 | SubLink string `json:"sublink,omitempty"` |
| 31 | |
| 32 | // Open the hyper link of subtitle in specified tab. |
| 33 | // options: |
| 34 | // 'self' opening it in current tab |
| 35 | // 'blank' opening it in a new tab |
| 36 | SubTarget string `json:"subtarget,omitempty"` |
| 37 | |
| 38 | // TextStyle of the sub title. |
| 39 | SubtitleStyle *TextStyle `json:"subtextStyle,omitempty"` |
| 40 | |
| 41 | // The horizontal align of the component (including "text" and "subtext"). |
| 42 | // Optional values: 'auto', 'left', 'right', 'center'. |
| 43 | TextAlign string `json:"textAlign,omitempty"` |
| 44 | // The vertical align of the component (including "text" and "subtext"). |
| 45 | // Optional values: 'auto', 'top', 'bottom', 'middle'. |
| 46 | TextVerticalAlign string `json:"textVerticalAlign,omitempty"` |
| 47 | |
| 48 | // Distance between title component and the left side of the container. |
| 49 | // left value can be instant pixel value like 20; it can also be a percentage |
| 50 | // value relative to container width like '20%'; and it can also be 'left', 'center', or 'right'. |
| 51 | // If the left value is set to be 'left', 'center', or 'right', |
| 52 | // then the component will be aligned automatically based on position. |
| 53 | Left string `json:"left,omitempty"` |
| 54 | |
| 55 | // Distance between title component and the top side of the container. |
| 56 | // top value can be instant pixel value like 20; it can also be a percentage |
| 57 | // value relative to container width like '20%'; and it can also be 'top', 'middle', or 'bottom'. |
| 58 | // If the left value is set to be 'top', 'middle', or 'bottom', |
| 59 | // then the component will be aligned automatically based on position. |
| 60 | Top string `json:"top,omitempty"` |
| 61 | |
| 62 | // Distance between title component and the right side of the container. |
| 63 | // right value can be instant pixel value like 20; it can also be a percentage |
| 64 | // value relative to container width like '20%'. |
| 65 | // Adaptive by default. |
| 66 | Right string `json:"right,omitempty"` |
| 67 | |
| 68 | // Distance between title component and the bottom side of the container. |
| 69 | // bottom value can be instant pixel value like 20; |
| 70 | // it can also be a percentage value relative to container width like '20%'. |
| 71 | // Adaptive by default. |
| 72 | Bottom string `json:"bottom,omitempty"` |
| 73 | |
| 74 | // TitleBackgroundColor Background color of title, which is transparent by default. |
| 75 | TitleBackgroundColor string `json:"backgroundColor,omitempty"` |
| 76 | |
| 77 | // BorderColor Border color of title. Support the same color format as backgroundColor. |
| 78 | BorderColor string `json:"borderColor,omitempty"` |
| 79 | |
| 80 | // BorderWidth Border width of title. |
| 81 | BorderWidth int `json:"borderWidth,omitempty"` |
| 82 | |
| 83 | // BorderRadius The radius of rounded corner. Its unit is px. And it supports use array to respectively specify the 4 corner radiuses. |
| 84 | // For example: |
| 85 | // borderRadius: 5, // consistently set the size of 4 rounded corners |
| 86 | // borderRadius: [5, 5, 0, 0] // (clockwise upper left, upper right, bottom right and bottom left) |
| 87 | // FYI, use [1] is same to number 1 |
| 88 | BorderRadius []int `json:"borderRadius,omitempty"` |
| 89 | |
| 90 | // Gauge |
| 91 | // Value position relative to the center of chart |
| 92 | // OffsetCenter is provided as [x, y] where x and y are either a number (px, provided |
| 93 | // as string) or a percentage. |
| 94 | // Positive values move the chart value to [right, bottom], negative values vice |
| 95 | // versa. |
| 96 | OffsetCenter []string `json:"offsetCenter,omitempty"` |
| 97 | } |