|
| 1 | +const contrastColor = 'rgba(255, 255, 255, 0.65)' |
| 2 | +const backgroundColor = 'transparent' |
| 3 | +const axisCommon = function () { |
| 4 | + return { |
| 5 | + axisLine: { |
| 6 | + lineStyle: { |
| 7 | + color: contrastColor, |
| 8 | + }, |
| 9 | + }, |
| 10 | + splitLine: { |
| 11 | + lineStyle: { |
| 12 | + color: '#484753', |
| 13 | + }, |
| 14 | + }, |
| 15 | + splitArea: { |
| 16 | + areaStyle: { |
| 17 | + color: ['rgba(255,255,255,0.02)', 'rgba(255,255,255,0.05)'], |
| 18 | + }, |
| 19 | + }, |
| 20 | + minorSplitLine: { |
| 21 | + lineStyle: { |
| 22 | + color: '#20203B', |
| 23 | + }, |
| 24 | + }, |
| 25 | + } |
| 26 | +} |
| 27 | + |
| 28 | +const colorPalette = [ |
| 29 | + '#4992ff', |
| 30 | + '#7cffb2', |
| 31 | + '#fddd60', |
| 32 | + '#ff6e76', |
| 33 | + '#58d9f9', |
| 34 | + '#05c091', |
| 35 | + '#ff8a45', |
| 36 | + '#8d48e3', |
| 37 | + '#dd79ff', |
| 38 | +] |
| 39 | +const theme: any = { |
| 40 | + color: colorPalette, |
| 41 | + backgroundColor, |
| 42 | + axisPointer: { |
| 43 | + lineStyle: { |
| 44 | + color: '#817f91', |
| 45 | + }, |
| 46 | + crossStyle: { |
| 47 | + color: '#817f91', |
| 48 | + }, |
| 49 | + label: { |
| 50 | + // TODO Contrast of label backgorundColor |
| 51 | + color: '#fff', |
| 52 | + }, |
| 53 | + }, |
| 54 | + legend: { |
| 55 | + textStyle: { |
| 56 | + color: contrastColor, |
| 57 | + }, |
| 58 | + }, |
| 59 | + textStyle: { |
| 60 | + color: contrastColor, |
| 61 | + }, |
| 62 | + title: { |
| 63 | + textStyle: { |
| 64 | + color: 'red', |
| 65 | + }, |
| 66 | + subtextStyle: { |
| 67 | + color: 'rgba(255, 255, 255, 0.65)', |
| 68 | + }, |
| 69 | + }, |
| 70 | + toolbox: { |
| 71 | + iconStyle: { |
| 72 | + borderColor: contrastColor, |
| 73 | + }, |
| 74 | + }, |
| 75 | + dataZoom: { |
| 76 | + borderColor: '#71708A', |
| 77 | + textStyle: { |
| 78 | + color: contrastColor, |
| 79 | + }, |
| 80 | + brushStyle: { |
| 81 | + color: 'rgba(135,163,206,0.3)', |
| 82 | + }, |
| 83 | + handleStyle: { |
| 84 | + color: '#353450', |
| 85 | + borderColor: '#C5CBE3', |
| 86 | + }, |
| 87 | + moveHandleStyle: { |
| 88 | + color: '#B0B6C3', |
| 89 | + opacity: 0.3, |
| 90 | + }, |
| 91 | + fillerColor: 'rgba(135,163,206,0.2)', |
| 92 | + emphasis: { |
| 93 | + handleStyle: { |
| 94 | + borderColor: '#91B7F2', |
| 95 | + color: '#4D587D', |
| 96 | + }, |
| 97 | + moveHandleStyle: { |
| 98 | + color: '#636D9A', |
| 99 | + opacity: 0.7, |
| 100 | + }, |
| 101 | + }, |
| 102 | + dataBackground: { |
| 103 | + lineStyle: { |
| 104 | + color: '#71708A', |
| 105 | + width: 1, |
| 106 | + }, |
| 107 | + areaStyle: { |
| 108 | + color: '#71708A', |
| 109 | + }, |
| 110 | + }, |
| 111 | + selectedDataBackground: { |
| 112 | + lineStyle: { |
| 113 | + color: '#87A3CE', |
| 114 | + }, |
| 115 | + areaStyle: { |
| 116 | + color: '#87A3CE', |
| 117 | + }, |
| 118 | + }, |
| 119 | + }, |
| 120 | + visualMap: { |
| 121 | + textStyle: { |
| 122 | + color: contrastColor, |
| 123 | + }, |
| 124 | + }, |
| 125 | + timeline: { |
| 126 | + lineStyle: { |
| 127 | + color: contrastColor, |
| 128 | + }, |
| 129 | + label: { |
| 130 | + color: contrastColor, |
| 131 | + }, |
| 132 | + controlStyle: { |
| 133 | + color: contrastColor, |
| 134 | + borderColor: contrastColor, |
| 135 | + }, |
| 136 | + }, |
| 137 | + calendar: { |
| 138 | + itemStyle: { |
| 139 | + color: backgroundColor, |
| 140 | + }, |
| 141 | + dayLabel: { |
| 142 | + color: contrastColor, |
| 143 | + }, |
| 144 | + monthLabel: { |
| 145 | + color: contrastColor, |
| 146 | + }, |
| 147 | + yearLabel: { |
| 148 | + color: contrastColor, |
| 149 | + }, |
| 150 | + }, |
| 151 | + timeAxis: axisCommon(), |
| 152 | + logAxis: axisCommon(), |
| 153 | + valueAxis: axisCommon(), |
| 154 | + categoryAxis: axisCommon(), |
| 155 | + |
| 156 | + line: { |
| 157 | + symbol: 'circle', |
| 158 | + }, |
| 159 | + graph: { |
| 160 | + color: colorPalette, |
| 161 | + }, |
| 162 | + gauge: { |
| 163 | + title: { |
| 164 | + color: contrastColor, |
| 165 | + }, |
| 166 | + }, |
| 167 | + candlestick: { |
| 168 | + itemStyle: { |
| 169 | + color: '#FD1050', |
| 170 | + color0: '#0CF49B', |
| 171 | + borderColor: '#FD1050', |
| 172 | + borderColor0: '#0CF49B', |
| 173 | + }, |
| 174 | + }, |
| 175 | +} |
| 176 | + |
| 177 | +theme.categoryAxis.splitLine.show = false |
| 178 | + |
| 179 | +export default theme |
0 commit comments