|
| 1 | +export const DEFAULT_GAUGE_PROGRESS_COLOR = '#0173BC'; |
| 2 | +export const DEFAULT_GAUGE_SETTINGS = { |
| 3 | + series: [ |
| 4 | + { |
| 5 | + type: 'gauge', |
| 6 | + center: ['50%', '50%'], //center of the gauge |
| 7 | + radius: '90%', //radius of the gauge |
| 8 | + startAngle: 190, //start angle of the gauge in degrees |
| 9 | + endAngle: -10, //end angle of the gauge in degrees |
| 10 | + min: 0, //guage default start point |
| 11 | + max: 100, //gauge default end point |
| 12 | + silent: true, //control mouse hover actions |
| 13 | + axisTick: { |
| 14 | + show: false, |
| 15 | + }, |
| 16 | + splitLine: { |
| 17 | + show: false, |
| 18 | + }, |
| 19 | + axisLabel: { |
| 20 | + show: false, |
| 21 | + }, |
| 22 | + axisLine: { |
| 23 | + /** |
| 24 | + * make axis line wider and default color in gray |
| 25 | + */ |
| 26 | + lineStyle: { |
| 27 | + width: 30, |
| 28 | + color: [[1, '#D5DBDB']], |
| 29 | + }, |
| 30 | + }, |
| 31 | + }, |
| 32 | + { |
| 33 | + type: 'gauge', |
| 34 | + center: ['50%', '50%'], //center of the gauge progress bar |
| 35 | + radius: '90%', //radius of the gauge progress bar |
| 36 | + startAngle: 190, //start angle of the gauge in degrees progress bar |
| 37 | + endAngle: -10, //end angle of the gauge in degrees progress bar |
| 38 | + silent: true, //control mouse hover actions |
| 39 | + min: 0, //guage progress bar default start point |
| 40 | + max: 100, //gauge progress bar default end point |
| 41 | + itemStyle: { |
| 42 | + color: DEFAULT_GAUGE_PROGRESS_COLOR, // default color for gauge progress bar |
| 43 | + }, |
| 44 | + progress: { |
| 45 | + show: true, |
| 46 | + width: 30, //gauge progress bar thickness |
| 47 | + }, |
| 48 | + pointer: { |
| 49 | + show: false, |
| 50 | + }, |
| 51 | + axisLine: { |
| 52 | + show: false, |
| 53 | + }, |
| 54 | + axisTick: { |
| 55 | + show: false, |
| 56 | + }, |
| 57 | + splitLine: { |
| 58 | + show: false, |
| 59 | + }, |
| 60 | + axisLabel: { |
| 61 | + show: false, |
| 62 | + }, |
| 63 | + detail: { |
| 64 | + /** |
| 65 | + * center value settings for color, position, animation, value font size & font weigth and unit size & font weight etc.. |
| 66 | + */ |
| 67 | + valueAnimation: true, // show animation while value changes |
| 68 | + offsetCenter: [0, '-10%'], // position of the center value |
| 69 | + fontSize: 25, // font size of the center value in px |
| 70 | + fontWeight: '500', // font weight of the center value in px |
| 71 | + formatter: '{value}', // formatter of the center value |
| 72 | + color: 'inherit', // color of the center value |
| 73 | + rich: { |
| 74 | + value: { |
| 75 | + fontWeight: 'bolder', // font weight of the value |
| 76 | + }, |
| 77 | + unit: { |
| 78 | + fontWeight: 'bolder', // font weight of the unit value |
| 79 | + padding: [0, 0, -15, -5], |
| 80 | + }, |
| 81 | + }, |
| 82 | + }, |
| 83 | + title: { |
| 84 | + /** |
| 85 | + * title settings for the position, width, overflow and ellipsis |
| 86 | + */ |
| 87 | + show: false, |
| 88 | + offsetCenter: [0, 10], |
| 89 | + width: 300, // width of the title in px |
| 90 | + overflow: 'truncate', |
| 91 | + ellipsis: '...', |
| 92 | + }, |
| 93 | + }, |
| 94 | + ], |
| 95 | +}; |
| 96 | +export const DEFAULT_GAUGE_SETTINGS_WITH_THRESHOLDS = { |
| 97 | + series: [ |
| 98 | + ...DEFAULT_GAUGE_SETTINGS.series, |
| 99 | + { |
| 100 | + type: 'gauge', |
| 101 | + center: ['50%', '50%'], //center of the gauge outside the arc |
| 102 | + radius: '92%', //radius of the gauge outside the arc |
| 103 | + startAngle: 190, //start angle of the gauge in degrees |
| 104 | + endAngle: -10, //end angle of the gauge in degrees |
| 105 | + min: 0, //outside the arc default start point |
| 106 | + max: 100, //outside the arc default end point |
| 107 | + silent: true, //control mouse hover actions |
| 108 | + splitNumber: 10, //number of split lines in the outside the arc |
| 109 | + progress: { |
| 110 | + show: false, |
| 111 | + }, |
| 112 | + pointer: { |
| 113 | + show: false, |
| 114 | + }, |
| 115 | + axisTick: { |
| 116 | + show: false, |
| 117 | + }, |
| 118 | + splitLine: { |
| 119 | + /** |
| 120 | + * make split line distance to oustside arc, length, wider, and default color in white |
| 121 | + */ |
| 122 | + distance: 0, |
| 123 | + length: 3, |
| 124 | + lineStyle: { |
| 125 | + width: 1, |
| 126 | + color: '#fff', |
| 127 | + }, |
| 128 | + }, |
| 129 | + axisLabel: { |
| 130 | + /** |
| 131 | + * make axis label distance to oustside arc, color and font size |
| 132 | + */ |
| 133 | + distance: -30, |
| 134 | + color: 'auto', |
| 135 | + fontSize: 10, |
| 136 | + }, |
| 137 | + axisLine: { |
| 138 | + /** |
| 139 | + * outside arc axis line thickness |
| 140 | + */ |
| 141 | + lineStyle: { |
| 142 | + width: 3, |
| 143 | + }, |
| 144 | + }, |
| 145 | + anchor: { |
| 146 | + show: false, |
| 147 | + }, |
| 148 | + detail: { |
| 149 | + /** |
| 150 | + * center value settings for color, position, animation, value font size, font weigth and unit size, font weight etc.. |
| 151 | + */ |
| 152 | + valueAnimation: true, // show animation while value changes |
| 153 | + offsetCenter: [0, '-10%'], // position of the center value |
| 154 | + fontSize: 25, //font size of the center value |
| 155 | + fontWeight: '500', //font weight of the center value |
| 156 | + formatter: '{value}', //formatter for the center value |
| 157 | + color: 'inherit', //color of the center value |
| 158 | + rich: { |
| 159 | + value: { |
| 160 | + fontWeight: 'bolder', //font weight of the value |
| 161 | + }, |
| 162 | + unit: { |
| 163 | + fontWeight: 'bolder', //font weight of the unit |
| 164 | + padding: [0, 0, -15, -5], |
| 165 | + }, |
| 166 | + }, |
| 167 | + }, |
| 168 | + title: { |
| 169 | + show: false, //hide title for outside arc |
| 170 | + }, |
| 171 | + }, |
| 172 | + ], |
| 173 | +}; |
0 commit comments