extrainit.uts 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. import { ChartOptionsExtraGaugeSplitLine, ChartOptionsExtra, ChartOptionsExtraArcbar, ChartOptionsExtraArea, ChartOptionsExtraBar, ChartOptionsExtraBubble, ChartOptionsExtraColumn, ChartOptionsExtraGauge, ChartOptionsExtraLine, ChartOptionsExtraMarkLine, ChartOptionsExtraMarkLineData, ChartOptionsExtraMix, ChartOptionsExtraMount, ChartOptionsExtraPie, ChartOptionsExtraRadar, ChartOptionsExtraRing, ChartOptionsExtraRose, ChartOptionsExtraScatter, ChartOptionsExtraTooltip, ChartOptionsExtraGaugePointer, ChartOptionsExtraFunnel, ChartOptionsExtraWord, ChartOptionsExtraCandle, ChartOptionsExtraCandleColor, ChartOptionsExtraCandleAverage, ChartOptionsExtraMap, ChartOptionsExtraMixColumn, ChartOptionsExtraMixArea, ChartOptionsExtraMixLine } from "./type"
  2. export function extraColumnInit(e : UTSJSONObject) : ChartOptionsExtraColumn {
  3. const extra_column = new ChartOptionsExtraColumn();
  4. if (e['type'] != null) extra_column.type = e.getString('type') as 'group' | 'stack' | 'meter';
  5. if (e['width'] != null) extra_column.width = e.getNumber('width')!;
  6. if (e['seriesGap'] != null) extra_column.seriesGap = e.getNumber('seriesGap')!;
  7. if (e['categoryGap'] != null) extra_column.categoryGap = e.getNumber('categoryGap')!;
  8. if (e['barBorderCircle'] != null) extra_column.barBorderCircle = e.getBoolean('barBorderCircle')!;
  9. if (e['barBorderRadius'] != null) extra_column.barBorderRadius = e.getArray('barBorderRadius') as number[];
  10. if (e['linearType'] != null) extra_column.linearType = e.getString('linearType') as 'none' | 'opacity' | 'custom';
  11. if (e['linearOpacity'] != null) extra_column.linearOpacity = e.getNumber('linearOpacity')!;
  12. if (e['customColor'] != null) extra_column.customColor = e.getArray('customColor') as string[];
  13. if (e['colorStop'] != null) extra_column.colorStop = e.getNumber('colorStop')!;
  14. if (e['meterBorder'] != null) extra_column.meterBorder = e.getNumber('meterBorder')!;
  15. if (e['meterFillColor'] != null) extra_column.meterFillColor = e.getString('meterFillColor')!;
  16. if (e['activeBgColor'] != null) extra_column.activeBgColor = e.getString('activeBgColor')!;
  17. if (e['activeBgOpacity'] != null) extra_column.activeBgOpacity = e.getNumber('activeBgOpacity')!;
  18. if (e['labelPosition'] != null) extra_column.labelPosition = e.getString('labelPosition') as 'outside' | 'insideTop' | 'center' | 'bottom';
  19. return extra_column;
  20. }
  21. export function extraMarkLineDataInit(e : UTSJSONObject) : ChartOptionsExtraMarkLineData {
  22. const extra_marklinedata = new ChartOptionsExtraMarkLineData();
  23. if (e['value'] != null) extra_marklinedata.value = e.getNumber('value');
  24. if (e['labelText'] != null) extra_marklinedata.labelText = e.getString('labelText');
  25. if (e['lineColor'] != null) extra_marklinedata.lineColor = e.getString('lineColor')!;
  26. if (e['showLabel'] != null) extra_marklinedata.showLabel = e.getBoolean('showLabel')!;
  27. if (e['labelAlign'] != null) extra_marklinedata.labelAlign = e.getString('labelAlign') as 'left' | 'right' | 'top' | 'bottom';
  28. if (e['labelOffsetX'] != null) extra_marklinedata.labelOffsetX = e.getNumber('labelOffsetX')!;
  29. if (e['labelOffsetY'] != null) extra_marklinedata.labelOffsetY = e.getNumber('labelOffsetY')!;
  30. if (e['labelPadding'] != null) extra_marklinedata.labelPadding = e.getNumber('labelPadding')!;
  31. if (e['labelFontSize'] != null) extra_marklinedata.labelFontSize = e.getNumber('labelFontSize')!;
  32. if (e['labelFontColor'] != null) extra_marklinedata.labelFontColor = e.getString('labelFontColor')!;
  33. if (e['labelBgColor'] != null) extra_marklinedata.labelBgColor = e.getString('labelBgColor')!;
  34. if (e['labelBgOpacity'] != null) extra_marklinedata.labelBgOpacity = e.getNumber('labelBgOpacity')!;
  35. if (e['yAxisIndex'] != null) extra_marklinedata.yAxisIndex = e.getNumber('yAxisIndex')!;
  36. if (e['y'] != null) extra_marklinedata.y = e.getNumber('y')!;
  37. return extra_marklinedata;
  38. }
  39. export function extraMarkLineInit(e : UTSJSONObject) : ChartOptionsExtraMarkLine {
  40. const extra_markline = new ChartOptionsExtraMarkLine();
  41. if (e['type'] != null) extra_markline.type = e.getString('type') as 'solid' | 'dash';
  42. if (e['dashLength'] != null) extra_markline.dashLength = e.getNumber('dashLength')!;
  43. if (e['data'] != null) {
  44. const markline_data : ChartOptionsExtraMarkLineData[] = []
  45. const data = e.getArray('data') as UTSJSONObject[]
  46. data.forEach((item : UTSJSONObject) => {
  47. markline_data.push(extraMarkLineDataInit(item))
  48. })
  49. extra_markline.data = markline_data
  50. }
  51. return extra_markline;
  52. }
  53. export function extraTooltipInit(e : UTSJSONObject) : ChartOptionsExtraTooltip {
  54. const extra_tooltip = new ChartOptionsExtraTooltip();
  55. if (e['showBox'] != null) extra_tooltip.showBox = e.getBoolean('showBox')!;
  56. if (e['showArrow'] != null) extra_tooltip.showArrow = e.getBoolean('showArrow')!;
  57. if (e['showCategory'] != null) extra_tooltip.showCategory = e.getBoolean('showCategory')!;
  58. if (e['borderWidth'] != null) extra_tooltip.borderWidth = e.getNumber('borderWidth')!;
  59. if (e['borderRadius'] != null) extra_tooltip.borderRadius = e.getNumber('borderRadius')!;
  60. if (e['borderColor'] != null) extra_tooltip.borderColor = e.getString('borderColor')!;
  61. if (e['borderOpacity'] != null) extra_tooltip.borderOpacity = e.getNumber('borderOpacity')!;
  62. if (e['bgColor'] != null) extra_tooltip.bgColor = e.getString('bgColor')!;
  63. if (e['bgOpacity'] != null) extra_tooltip.bgOpacity = e.getNumber('bgOpacity')!;
  64. if (e['gridType'] != null) extra_tooltip.gridType = e.getString('gridType') as 'solid' | 'dash';
  65. if (e['dashLength'] != null) extra_tooltip.dashLength = e.getNumber('dashLength')!;
  66. if (e['gridColor'] != null) extra_tooltip.gridColor = e.getString('gridColor')!;
  67. if (e['boxPadding'] != null) extra_tooltip.boxPadding = e.getNumber('boxPadding')!;
  68. if (e['fontSize'] != null) extra_tooltip.fontSize = e.getNumber('fontSize')!;
  69. if (e['lineHeight'] != null) extra_tooltip.lineHeight = e.getNumber('lineHeight')!;
  70. if (e['fontColor'] != null) extra_tooltip.fontColor = e.getString('fontColor')!;
  71. if (e['legendShow'] != null) extra_tooltip.legendShow = e.getBoolean('legendShow')!;
  72. if (e['legendShape'] != null) extra_tooltip.legendShape = e.getString('legendShape') as 'auto' | 'diamond' | 'circle' | 'triangle' | 'square' | 'rect' | 'line';
  73. if (e['splitLine'] != null) extra_tooltip.splitLine = e.getBoolean('splitLine')!;
  74. if (e['horizentalLine'] != null) extra_tooltip.horizentalLine = e.getBoolean('horizentalLine')!;
  75. if (e['xAxisLabel'] != null) extra_tooltip.xAxisLabel = e.getBoolean('xAxisLabel')!;
  76. if (e['yAxisLabel'] != null) extra_tooltip.yAxisLabel = e.getBoolean('yAxisLabel')!;
  77. if (e['labelBgColor'] != null) extra_tooltip.labelBgColor = e.getString('labelBgColor')!;
  78. if (e['labelBgOpacity'] != null) extra_tooltip.labelBgOpacity = e.getNumber('labelBgOpacity')!;
  79. if (e['labelFontColor'] != null) extra_tooltip.labelFontColor = e.getString('labelFontColor')!;
  80. return extra_tooltip;
  81. }
  82. export function extraMountInit(e : UTSJSONObject) : ChartOptionsExtraMount {
  83. const extra_mount = new ChartOptionsExtraMount();
  84. if (e['type'] != null) extra_mount.type = e.getString('type') as 'mount' | 'sharp' | 'triangle' | 'bar';
  85. if (e['widthRatio'] != null) extra_mount.widthRatio = e.getNumber('widthRatio')!;
  86. if (e['borderWidth'] != null) extra_mount.borderWidth = e.getNumber('borderWidth')!;
  87. if (e['barBorderCircle'] != null) extra_mount.barBorderCircle = e.getBoolean('barBorderCircle')!;
  88. if (e['barBorderRadius'] != null) extra_mount.barBorderRadius = e.getArray('barBorderRadius') as number[];
  89. if (e['linearType'] != null) extra_mount.linearType = e.getString('linearType') as 'none' | 'opacity' | 'custom';
  90. if (e['linearOpacity'] != null) extra_mount.linearOpacity = e.getNumber('linearOpacity')!;
  91. if (e['customColor'] != null) extra_mount.customColor = e.getArray('customColor') as string[];
  92. if (e['colorStop'] != null) extra_mount.colorStop = e.getNumber('colorStop') as number;
  93. return extra_mount;
  94. }
  95. export function extraBarInit(e : UTSJSONObject) : ChartOptionsExtraBar {
  96. const extraBar = new ChartOptionsExtraBar();
  97. if (e['type'] != null) extraBar.type = e.getString('type') as 'group' | 'stack';
  98. if (e['width'] != null) extraBar.width = e.getNumber('width')!;
  99. if (e['seriesGap'] != null) extraBar.seriesGap = e.getNumber('seriesGap')!;
  100. if (e['categoryGap'] != null) extraBar.categoryGap = e.getNumber('categoryGap')!;
  101. if (e['barBorderCircle'] != null) extraBar.barBorderCircle = e.getBoolean('barBorderCircle')!;
  102. if (e['barBorderRadius'] != null) extraBar.barBorderRadius = e.getArray('barBorderRadius') as number[];
  103. if (e['linearType'] != null) extraBar.linearType = e.getString('linearType') as 'none' | 'opacity' | 'custom';
  104. if (e['linearOpacity'] != null) extraBar.linearOpacity = e.getNumber('linearOpacity')!;
  105. if (e['customColor'] != null) extraBar.customColor = e.getArray('customColor') as string[];
  106. if (e['colorStop'] != null) extraBar.colorStop = e.getNumber('colorStop')!;
  107. if (e['activeBgColor'] != null) extraBar.activeBgColor = e.getString('activeBgColor')!;
  108. if (e['activeBgOpacity'] != null) extraBar.activeBgOpacity = e.getNumber('activeBgOpacity')!;
  109. return extraBar;
  110. }
  111. export function extraLineInit(e : UTSJSONObject) : ChartOptionsExtraLine {
  112. const extraLine = new ChartOptionsExtraLine();
  113. if (e['type'] != null) extraLine.type = e.getString('type') as 'straight' | 'curve' | 'step';
  114. if (e['width'] != null) extraLine.width = e.getNumber('width')!;
  115. if (e['activeType'] != null) extraLine.activeType = e.getString('activeType') as 'none' | 'hollow' | 'solid';
  116. if (e['linearType'] != null) extraLine.linearType = e.getString('linearType') as 'none' | 'custom';
  117. if (e['onShadow'] != null) extraLine.onShadow = e.getBoolean('onShadow')!;
  118. if (e['animation'] != null) extraLine.animation = e.getString('animation') as 'vertical' | 'horizontal';
  119. return extraLine;
  120. }
  121. export function extraAreaInit(e : UTSJSONObject) : ChartOptionsExtraArea {
  122. const extraArea = new ChartOptionsExtraArea();
  123. if (e['type'] != null) extraArea.type = e.getString('type') as 'straight' | 'curve' | 'step';
  124. if (e['opacity'] != null) extraArea.opacity = e.getNumber('opacity')!;
  125. if (e['addLine'] != null) extraArea.addLine = e.getBoolean('addLine')!;
  126. if (e['width'] != null) extraArea.width = e.getNumber('width')!;
  127. if (e['gradient'] != null) extraArea.gradient = e.getBoolean('gradient')!;
  128. if (e['activeType'] != null) extraArea.activeType = e.getString('activeType') as 'none' | 'hollow' | 'solid';
  129. return extraArea;
  130. }
  131. export function extraPieInit(e : UTSJSONObject) : ChartOptionsExtraPie {
  132. const extraPie = new ChartOptionsExtraPie();
  133. if (e['activeOpacity'] != null) extraPie.activeOpacity = e.getNumber('activeOpacity')!;
  134. if (e['activeRadius'] != null) extraPie.activeRadius = e.getNumber('activeRadius')!;
  135. if (e['offsetAngle'] != null) extraPie.offsetAngle = e.getNumber('offsetAngle')!;
  136. if (e['customRadius'] != null) extraPie.customRadius = e.getNumber('customRadius')!;
  137. if (e['labelWidth'] != null) extraPie.labelWidth = e.getNumber('labelWidth')!;
  138. if (e['border'] != null) extraPie.border = e.getBoolean('border')!;
  139. if (e['borderWidth'] != null) extraPie.borderWidth = e.getNumber('borderWidth')!;
  140. if (e['borderColor'] != null) extraPie.borderColor = e.getString('borderColor')!;
  141. if (e['linearType'] != null) extraPie.linearType = e.getString('linearType') as 'none' | 'custom';
  142. if (e['customColor'] != null) extraPie.customColor = e.getArray('customColor') as string[];
  143. return extraPie;
  144. }
  145. export function extraRingInit(e : UTSJSONObject) : ChartOptionsExtraRing {
  146. const extraRing = new ChartOptionsExtraRing();
  147. if (e['ringWidth'] != null) extraRing.ringWidth = e.getNumber('ringWidth')!;
  148. if (e['centerColor'] != null) extraRing.centerColor = e.getString('centerColor')!;
  149. if (e['activeOpacity'] != null) extraRing.activeOpacity = e.getNumber('activeOpacity')!;
  150. if (e['activeRadius'] != null) extraRing.activeRadius = e.getNumber('activeRadius')!;
  151. if (e['offsetAngle'] != null) extraRing.offsetAngle = e.getNumber('offsetAngle');
  152. if (e['customRadius'] != null) extraRing.customRadius = e.getNumber('customRadius');
  153. if (e['labelWidth'] != null) extraRing.labelWidth = e.getNumber('labelWidth')!;
  154. if (e['border'] != null) extraRing.border = e.getBoolean('border')!;
  155. if (e['borderWidth'] != null) extraRing.borderWidth = e.getNumber('borderWidth')!;
  156. if (e['borderColor'] != null) extraRing.borderColor = e.getString('borderColor')!;
  157. if (e['linearType'] != null) extraRing.linearType = e.getString('linearType') as 'none' | 'custom';
  158. if (e['customColor'] != null) extraRing.customColor = e.getArray('customColor') as string[];
  159. return extraRing;
  160. }
  161. export function extraRoseInit(e : UTSJSONObject) : ChartOptionsExtraRose {
  162. const extraRose = new ChartOptionsExtraRose();
  163. if (e['type'] != null) extraRose.type = e.getString('type') as 'area' | 'radius';
  164. if (e['minRadius'] != null) extraRose.minRadius = e.getNumber('minRadius');
  165. if (e['activeOpacity'] != null) extraRose.activeOpacity = e.getNumber('activeOpacity')!;
  166. if (e['activeRadius'] != null) extraRose.activeRadius = e.getNumber('activeRadius')!;
  167. if (e['offsetAngle'] != null) extraRose.offsetAngle = e.getNumber('offsetAngle');
  168. if (e['labelWidth'] != null) extraRose.labelWidth = e.getNumber('labelWidth')!;
  169. if (e['border'] != null) extraRose.border = e.getBoolean('border')!;
  170. if (e['borderWidth'] != null) extraRose.borderWidth = e.getNumber('borderWidth')!;
  171. if (e['borderColor'] != null) extraRose.borderColor = e.getString('borderColor')!;
  172. if (e['linearType'] != null) extraRose.linearType = e.getString('linearType') as 'none' | 'custom';
  173. if (e['customColor'] != null) extraRose.customColor = e.getArray('customColor') as string[];
  174. return extraRose;
  175. }
  176. export function extraScatterInit(e : UTSJSONObject) : ChartOptionsExtraScatter {
  177. const extraScatter = new ChartOptionsExtraScatter();
  178. if (e['id'] != null) extraScatter.id = e.getString('id');
  179. return extraScatter;
  180. }
  181. export function extraBubbleInit(e : UTSJSONObject) : ChartOptionsExtraBubble {
  182. const extraBubble = new ChartOptionsExtraBubble();
  183. if (e['border'] != null) extraBubble.border = e.getNumber('border')!;
  184. if (e['opacity'] != null) extraBubble.opacity = e.getNumber('opacity')!;
  185. return extraBubble;
  186. }
  187. export function extraMixColumnInit(e : UTSJSONObject) : ChartOptionsExtraMixColumn {
  188. const extraMixColumn = new ChartOptionsExtraMixColumn();
  189. if (e['width'] != null) extraMixColumn.width = e.getNumber('width')!;
  190. if (e['seriesGap'] != null) extraMixColumn.seriesGap = e.getNumber('seriesGap')!;
  191. if (e['categoryGap'] != null) extraMixColumn.categoryGap = e.getNumber('categoryGap')!;
  192. if (e['barBorderCircle'] != null) extraMixColumn.barBorderCircle = e.getBoolean('barBorderCircle')!;
  193. if (e['barBorderRadius'] != null) extraMixColumn.barBorderRadius = e.getArray('barBorderRadius') as number[];
  194. if (e['linearType'] != null) extraMixColumn.linearType = e.getString('linearType') as 'none' | 'opacity' | 'custom';
  195. if (e['linearOpacity'] != null) extraMixColumn.linearOpacity = e.getNumber('linearOpacity')!;
  196. if (e['customColor'] != null) extraMixColumn.customColor = e.getArray('customColor') as string[];
  197. if (e['colorStop'] != null) extraMixColumn.colorStop = e.getNumber('colorStop')!;
  198. return extraMixColumn;
  199. }
  200. export function extraMixAreaInit(e : UTSJSONObject) : ChartOptionsExtraMixArea {
  201. const extraMixArea = new ChartOptionsExtraMixArea();
  202. if (e['gradient'] != null) extraMixArea.gradient = e.getBoolean('gradient')!;
  203. if (e['opacity'] != null) extraMixArea.opacity = e.getNumber('opacity')!;
  204. return extraMixArea;
  205. }
  206. export function extraMixLineInit(e : UTSJSONObject) : ChartOptionsExtraMixLine {
  207. const extraMixLine = new ChartOptionsExtraMixLine();
  208. if (e['width'] != null) extraMixLine.width = e.getNumber('width')!;
  209. return extraMixLine;
  210. }
  211. export function extraMixInit(e : UTSJSONObject) : ChartOptionsExtraMix {
  212. const extraMix = new ChartOptionsExtraMix()
  213. if (e['column'] != null) {
  214. extraMix.column = extraMixColumnInit(e.getJSON('column')!)
  215. }
  216. if (e['area'] != null) {
  217. extraMix.area = extraMixAreaInit(e.getJSON('area')!)
  218. }
  219. if (e['line'] != null) {
  220. extraMix.line = extraMixLineInit(e.getJSON('line')!)
  221. }
  222. return extraMix
  223. }
  224. export function extraRadarInit(e : UTSJSONObject) : ChartOptionsExtraRadar {
  225. const extraRadar = new ChartOptionsExtraRadar();
  226. if (e['gridType'] != null) extraRadar.gridType = e.getString('gridType') as 'radar' | 'circle';
  227. if (e['gridColor'] != null) extraRadar.gridColor = e.getString('gridColor')!;
  228. if (e['gridCount'] != null) extraRadar.gridCount = e.getNumber('gridCount')!;
  229. if (e['gridEval'] != null) extraRadar.gridEval = e.getNumber('gridEval')!;
  230. if (e['radius'] != null) extraRadar.radius = e.getNumber('radius')!;
  231. if (e['axisLabel'] != null) extraRadar.axisLabel = e.getBoolean('axisLabel')!;
  232. if (e['axisLabelTofix'] != null) extraRadar.axisLabelTofix = e.getNumber('axisLabelTofix')!;
  233. if (e['labelShow'] != null) extraRadar.labelShow = e.getBoolean('labelShow')!;
  234. if (e['labelColor'] != null) extraRadar.labelColor = e.getString('labelColor')!;
  235. if (e['labelPointShow'] != null) extraRadar.labelPointShow = e.getBoolean('labelPointShow')!;
  236. if (e['labelPointRadius'] != null) extraRadar.labelPointRadius = e.getNumber('labelPointRadius')!;
  237. if (e['labelPointColor'] != null) extraRadar.labelPointColor = e.getString('labelPointColor')!;
  238. if (e['opacity'] != null) extraRadar.opacity = e.getNumber('opacity')!;
  239. if (e['border'] != null) extraRadar.border = e.getBoolean('border')!;
  240. if (e['borderWidth'] != null) extraRadar.borderWidth = e.getNumber('borderWidth')!;
  241. if (e['max'] != null) extraRadar.max = e.getNumber('max')!;
  242. if (e['linearType'] != null) extraRadar.linearType = e.getString('linearType') as 'none' | 'custom';
  243. if (e['customColor'] != null) extraRadar.customColor = e.getArray('customColor') as string[];
  244. return extraRadar;
  245. }
  246. export function extraArcbarInit(e : UTSJSONObject) : ChartOptionsExtraArcbar {
  247. const extraArcbar = new ChartOptionsExtraArcbar();
  248. if (e['type'] != null) extraArcbar.type = e.getString('type') as 'default' | 'circle';
  249. if (e['direction'] != null) extraArcbar.direction = e.getString('direction') as 'cw' | 'ccw';
  250. if (e['width'] != null) extraArcbar.width = e.getNumber('width')!;
  251. if (e['lineCap'] != null) extraArcbar.lineCap = e.getString('lineCap') as 'round' | 'square' | 'butt';
  252. if (e['backgroundColor'] != null) extraArcbar.backgroundColor = e.getString('backgroundColor')!;
  253. if (e['startAngle'] != null) extraArcbar.startAngle = e.getNumber('startAngle')!;
  254. if (e['endAngle'] != null) extraArcbar.endAngle = e.getNumber('endAngle')!;
  255. if (e['radius'] != null) extraArcbar.radius = e.getNumber('radius')!;
  256. if (e['gap'] != null) extraArcbar.gap = e.getNumber('gap')!;
  257. if (e['centerX'] != null) extraArcbar.centerX = e.getNumber('centerX')!;
  258. if (e['centerY'] != null) extraArcbar.centerY = e.getNumber('centerY')!;
  259. if (e['linearType'] != null) extraArcbar.linearType = e.getString('linearType') as 'none' | 'custom';
  260. if (e['customColor'] != null) extraArcbar.customColor = e.getArray('customColor') as string[];
  261. return extraArcbar;
  262. }
  263. export function extraGaugePointerInit(e : UTSJSONObject) : ChartOptionsExtraGaugePointer {
  264. const extraGaugePointer = new ChartOptionsExtraGaugePointer();
  265. if (e['width'] != null) extraGaugePointer.width = e.getNumber('width')!;
  266. if (e['color'] != null) extraGaugePointer.color = e.getString('color')!;
  267. return extraGaugePointer;
  268. }
  269. export function extraGaugeSplitLineInit(e : UTSJSONObject) : ChartOptionsExtraGaugeSplitLine {
  270. const extraGaugeSplitLine = new ChartOptionsExtraGaugeSplitLine();
  271. if (e['fixRadius'] != null) extraGaugeSplitLine.fixRadius = e.getNumber('fixRadius')!;
  272. if (e['splitNumber'] != null) extraGaugeSplitLine.splitNumber = e.getNumber('splitNumber')!;
  273. if (e['width'] != null) extraGaugeSplitLine.width = e.getNumber('width')!;
  274. if (e['color'] != null) extraGaugeSplitLine.color = e.getString('color')!;
  275. if (e['childNumber'] != null) extraGaugeSplitLine.childNumber = e.getNumber('childNumber')!;
  276. if (e['childWidth'] != null) extraGaugeSplitLine.childWidth = e.getNumber('childWidth')!;
  277. return extraGaugeSplitLine;
  278. }
  279. export function extraGaugeInit(e : UTSJSONObject) : ChartOptionsExtraGauge {
  280. const extraGauge = new ChartOptionsExtraGauge();
  281. if (e['type'] != null) extraGauge.type = e.getString('type')!;
  282. if (e['width'] != null) extraGauge.width = e.getNumber('width')!;
  283. if (e['labelColor'] != null) extraGauge.labelColor = e.getString('labelColor')!;
  284. if (e['labelOffset'] != null) extraGauge.labelOffset = e.getNumber('labelOffset')!;
  285. if (e['startAngle'] != null) extraGauge.startAngle = e.getNumber('startAngle')!;
  286. if (e['endAngle'] != null) extraGauge.endAngle = e.getNumber('endAngle')!;
  287. if (e['startNumber'] != null) extraGauge.startNumber = e.getNumber('startNumber')!;
  288. if (e['endNumber'] != null) extraGauge.endNumber = e.getNumber('endNumber')!;
  289. if (e['formatter'] != null) extraGauge.formatter = e.getAny('formatter')!;
  290. if (e['format'] != null) extraGauge.format = e.getString('format')!;
  291. if (e['splitLine'] != null) {
  292. extraGauge.splitLine = extraGaugeSplitLineInit(e.getJSON('splitLine')!)
  293. }
  294. if (e['pointer'] != null) {
  295. extraGauge.pointer = extraGaugePointerInit(e.getJSON('pointer')!)
  296. }
  297. return extraGauge;
  298. }
  299. export function extraFunnelInit(e : UTSJSONObject) : ChartOptionsExtraFunnel {
  300. const extraFunnel = new ChartOptionsExtraFunnel();
  301. if (e['type'] != null) extraFunnel.type = e.getString('type') as 'funnel' | 'triangle' | 'pyramid';
  302. if (e['activeOpacity'] != null) extraFunnel.activeOpacity = e.getNumber('activeOpacity')!;
  303. if (e['activeWidth'] != null) extraFunnel.activeWidth = e.getNumber('activeWidth')!;
  304. if (e['border'] != null) extraFunnel.border = e.getBoolean('border')!;
  305. if (e['borderWidth'] != null) extraFunnel.borderWidth = e.getNumber('borderWidth')!;
  306. if (e['borderColor'] != null) extraFunnel.borderColor = e.getString('borderColor')!;
  307. if (e['fillOpacity'] != null) extraFunnel.fillOpacity = e.getNumber('fillOpacity')!;
  308. if (e['minSize'] != null) extraFunnel.minSize = e.getNumber('minSize')!;
  309. if (e['labelAlign'] != null) extraFunnel.labelAlign = e.getString('labelAlign') as 'right' | 'left';
  310. if (e['linearType'] != null) extraFunnel.linearType = e.getString('linearType') as 'none' | 'custom';
  311. if (e['customColor'] != null) extraFunnel.customColor = e.getArray('customColor') as string[];
  312. return extraFunnel;
  313. }
  314. export function extraWordInit(e : UTSJSONObject) : ChartOptionsExtraWord {
  315. const extraWord = new ChartOptionsExtraWord();
  316. if (e['type'] != null) extraWord.type = e.getString('type') as 'normal' | 'vertical';
  317. if (e['autoColors'] != null) extraWord.autoColors = e.getBoolean('autoColors')!;
  318. return extraWord;
  319. }
  320. export function extraCandleColorInit(e : UTSJSONObject) : ChartOptionsExtraCandleColor {
  321. const extraCandleColor = new ChartOptionsExtraCandleColor();
  322. if (e['upLine'] != null) extraCandleColor.upLine = e.getString('upLine')!;
  323. if (e['upFill'] != null) extraCandleColor.upFill = e.getString('upFill')!;
  324. if (e['downLine'] != null) extraCandleColor.downLine = e.getString('downLine')!;
  325. if (e['downFill'] != null) extraCandleColor.downFill = e.getString('downFill')!;
  326. return extraCandleColor;
  327. }
  328. export function extraCandleAverageInit(e : UTSJSONObject) : ChartOptionsExtraCandleAverage {
  329. const extraCandleAverage = new ChartOptionsExtraCandleAverage();
  330. if (e['show'] != null) extraCandleAverage.show = e.getBoolean('show')!;
  331. if (e['name'] != null) extraCandleAverage.name = e.getArray('name') as string[];
  332. if (e['day'] != null) extraCandleAverage.day = e.getArray('day') as number[];
  333. if (e['color'] != null) extraCandleAverage.color = e.getArray('color') as string[];
  334. return extraCandleAverage;
  335. }
  336. export function extraCandlelInit(e : UTSJSONObject) : ChartOptionsExtraCandle {
  337. const extraCandle = new ChartOptionsExtraCandle()
  338. if (e['color'] != null) {
  339. extraCandle.color = extraCandleColorInit(e.getJSON('color')!)
  340. }
  341. if (e['average'] != null) {
  342. extraCandle.average = extraCandleAverageInit(e.getJSON('average')!)
  343. }
  344. return extraCandle
  345. }
  346. export function extraMapInit(e : UTSJSONObject) : ChartOptionsExtraMap {
  347. const extraMap = new ChartOptionsExtraMap();
  348. if (e['border'] != null) extraMap.border = e.getBoolean('border')!;
  349. if (e['mercator'] != null) extraMap.mercator = e.getBoolean('mercator')!;
  350. if (e['borderWidth'] != null) extraMap.borderWidth = e.getNumber('borderWidth')!;
  351. if (e['borderColor'] != null) extraMap.borderColor = e.getString('borderColor')!;
  352. if (e['fillOpacity'] != null) extraMap.fillOpacity = e.getNumber('fillOpacity')!;
  353. if (e['active'] != null) extraMap.active = e.getBoolean('active')!;
  354. if (e['activeTextColor'] != null) extraMap.activeTextColor = e.getString('activeTextColor')!;
  355. if (e['activeBorderColor'] != null) extraMap.activeBorderColor = e.getString('activeBorderColor')!;
  356. if (e['activeFillColor'] != null) extraMap.activeFillColor = e.getString('activeFillColor')!;
  357. if (e['activeFillOpacity'] != null) extraMap.activeFillOpacity = e.getNumber('activeFillOpacity')!;
  358. return extraMap;
  359. }
  360. export function extraInit(e : UTSJSONObject) : ChartOptionsExtra {
  361. const extra = new ChartOptionsExtra()
  362. if (e['column'] != null) {
  363. extra.column = extraColumnInit(e.getJSON('column')!)
  364. }
  365. if (e['markLine'] != null) {
  366. extra.markLine = extraMarkLineInit(e.getJSON('markLine')!)
  367. }
  368. if (e['tooltip'] != null) {
  369. extra.tooltip = extraTooltipInit(e.getJSON('tooltip')!)
  370. }
  371. if (e['mount'] != null) {
  372. extra.mount = extraMountInit(e.getJSON('mount')!)
  373. }
  374. if (e['bar'] != null) {
  375. extra.bar = extraBarInit(e.getJSON('bar')!)
  376. }
  377. if (e['line'] != null) {
  378. extra.line = extraLineInit(e.getJSON('line')!)
  379. }
  380. if (e['area'] != null) {
  381. extra.area = extraAreaInit(e.getJSON('area')!)
  382. }
  383. if (e['pie'] != null) {
  384. extra.pie = extraPieInit(e.getJSON('pie')!)
  385. }
  386. if (e['ring'] != null) {
  387. extra.ring = extraRingInit(e.getJSON('ring')!)
  388. }
  389. if (e['rose'] != null) {
  390. extra.rose = extraRoseInit(e.getJSON('rose')!)
  391. }
  392. if (e['scatter'] != null) {
  393. extra.scatter = extraScatterInit(e.getJSON('scatter')!)
  394. }
  395. if (e['bubble'] != null) {
  396. extra.bubble = extraBubbleInit(e.getJSON('bubble')!)
  397. }
  398. if (e['mix'] != null) {
  399. extra.mix = extraMixInit(e.getJSON('mix')!)
  400. }
  401. if (e['radar'] != null) {
  402. extra.radar = extraRadarInit(e.getJSON('radar')!)
  403. }
  404. if (e['arcbar'] != null) {
  405. extra.arcbar = extraArcbarInit(e.getJSON('arcbar')!)
  406. }
  407. if (e['gauge'] != null) {
  408. extra.gauge = extraGaugeInit(e.getJSON('gauge')!)
  409. }
  410. if (e['funnel'] != null) {
  411. extra.funnel = extraFunnelInit(e.getJSON('funnel')!)
  412. }
  413. if (e['word'] != null) {
  414. extra.word = extraWordInit(e.getJSON('word')!)
  415. }
  416. if (e['candle'] != null) {
  417. extra.candle = extraCandlelInit(e.getJSON('candle')!)
  418. }
  419. if (e['map'] != null) {
  420. extra.map = extraMapInit(e.getJSON('map')!)
  421. }
  422. return extra
  423. }