@techie_doubts/tui.chart.2026 4.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/README.md +165 -0
  2. package/dist/esm/animator.d.ts +32 -0
  3. package/dist/esm/animator.js +102 -0
  4. package/dist/esm/brushes/axis.d.ts +3 -0
  5. package/dist/esm/brushes/axis.js +21 -0
  6. package/dist/esm/brushes/basic.d.ts +9 -0
  7. package/dist/esm/brushes/basic.js +95 -0
  8. package/dist/esm/brushes/boxPlot.d.ts +2 -0
  9. package/dist/esm/brushes/boxPlot.js +22 -0
  10. package/dist/esm/brushes/circleLegend.d.ts +2 -0
  11. package/dist/esm/brushes/circleLegend.js +26 -0
  12. package/dist/esm/brushes/dataLabel.d.ts +6 -0
  13. package/dist/esm/brushes/dataLabel.js +176 -0
  14. package/dist/esm/brushes/exportMenu.d.ts +2 -0
  15. package/dist/esm/brushes/exportMenu.js +55 -0
  16. package/dist/esm/brushes/gauge.d.ts +2 -0
  17. package/dist/esm/brushes/gauge.js +39 -0
  18. package/dist/esm/brushes/label.d.ts +34 -0
  19. package/dist/esm/brushes/label.js +165 -0
  20. package/dist/esm/brushes/legend.d.ts +7 -0
  21. package/dist/esm/brushes/legend.js +162 -0
  22. package/dist/esm/brushes/lineSeries.d.ts +5 -0
  23. package/dist/esm/brushes/lineSeries.js +41 -0
  24. package/dist/esm/brushes/polygon.d.ts +2 -0
  25. package/dist/esm/brushes/polygon.js +24 -0
  26. package/dist/esm/brushes/resetButton.d.ts +3 -0
  27. package/dist/esm/brushes/resetButton.js +112 -0
  28. package/dist/esm/brushes/scatterSeries.d.ts +2 -0
  29. package/dist/esm/brushes/scatterSeries.js +125 -0
  30. package/dist/esm/brushes/sector.d.ts +2 -0
  31. package/dist/esm/brushes/sector.js +54 -0
  32. package/dist/esm/brushes/spectrumLegend.d.ts +14 -0
  33. package/dist/esm/brushes/spectrumLegend.js +199 -0
  34. package/dist/esm/charts/areaChart.d.ts +254 -0
  35. package/dist/esm/charts/areaChart.js +358 -0
  36. package/dist/esm/charts/barChart.d.ts +203 -0
  37. package/dist/esm/charts/barChart.js +300 -0
  38. package/dist/esm/charts/boxPlotChart.d.ts +209 -0
  39. package/dist/esm/charts/boxPlotChart.js +288 -0
  40. package/dist/esm/charts/bubbleChart.d.ts +188 -0
  41. package/dist/esm/charts/bubbleChart.js +263 -0
  42. package/dist/esm/charts/bulletChart.d.ts +199 -0
  43. package/dist/esm/charts/bulletChart.js +278 -0
  44. package/dist/esm/charts/chart.d.ts +133 -0
  45. package/dist/esm/charts/chart.js +484 -0
  46. package/dist/esm/charts/columnChart.d.ts +205 -0
  47. package/dist/esm/charts/columnChart.js +299 -0
  48. package/dist/esm/charts/columnLineChart.d.ts +271 -0
  49. package/dist/esm/charts/columnLineChart.js +386 -0
  50. package/dist/esm/charts/gaugeChart.d.ts +191 -0
  51. package/dist/esm/charts/gaugeChart.js +279 -0
  52. package/dist/esm/charts/heatmapChart.d.ts +199 -0
  53. package/dist/esm/charts/heatmapChart.js +292 -0
  54. package/dist/esm/charts/lineAreaChart.d.ts +271 -0
  55. package/dist/esm/charts/lineAreaChart.js +374 -0
  56. package/dist/esm/charts/lineChart.d.ts +253 -0
  57. package/dist/esm/charts/lineChart.js +360 -0
  58. package/dist/esm/charts/lineScatterChart.d.ts +200 -0
  59. package/dist/esm/charts/lineScatterChart.js +285 -0
  60. package/dist/esm/charts/nestedPieChart.d.ts +192 -0
  61. package/dist/esm/charts/nestedPieChart.js +268 -0
  62. package/dist/esm/charts/pieChart.d.ts +156 -0
  63. package/dist/esm/charts/pieChart.js +224 -0
  64. package/dist/esm/charts/radarChart.d.ts +169 -0
  65. package/dist/esm/charts/radarChart.js +240 -0
  66. package/dist/esm/charts/radialBarChart.d.ts +172 -0
  67. package/dist/esm/charts/radialBarChart.js +251 -0
  68. package/dist/esm/charts/scatterChart.d.ts +184 -0
  69. package/dist/esm/charts/scatterChart.js +279 -0
  70. package/dist/esm/charts/treemapChart.d.ts +166 -0
  71. package/dist/esm/charts/treemapChart.js +239 -0
  72. package/dist/esm/component/areaSeries.d.ts +96 -0
  73. package/dist/esm/component/areaSeries.js +474 -0
  74. package/dist/esm/component/axis.d.ts +40 -0
  75. package/dist/esm/component/axis.js +176 -0
  76. package/dist/esm/component/axisTitle.d.ts +25 -0
  77. package/dist/esm/component/axisTitle.js +67 -0
  78. package/dist/esm/component/axisUsingCenterY.d.ts +32 -0
  79. package/dist/esm/component/axisUsingCenterY.js +175 -0
  80. package/dist/esm/component/backButton.d.ts +13 -0
  81. package/dist/esm/component/backButton.js +26 -0
  82. package/dist/esm/component/background.d.ts +10 -0
  83. package/dist/esm/component/background.js +15 -0
  84. package/dist/esm/component/boxPlotSeries.d.ts +126 -0
  85. package/dist/esm/component/boxPlotSeries.js +410 -0
  86. package/dist/esm/component/boxSeries.d.ts +211 -0
  87. package/dist/esm/component/boxSeries.js +603 -0
  88. package/dist/esm/component/boxStackSeries.d.ts +62 -0
  89. package/dist/esm/component/boxStackSeries.js +447 -0
  90. package/dist/esm/component/bubbleSeries.d.ts +35 -0
  91. package/dist/esm/component/bubbleSeries.js +174 -0
  92. package/dist/esm/component/bulletSeries.d.ts +89 -0
  93. package/dist/esm/component/bulletSeries.js +392 -0
  94. package/dist/esm/component/circleLegend.d.ts +10 -0
  95. package/dist/esm/component/circleLegend.js +37 -0
  96. package/dist/esm/component/component.d.ts +64 -0
  97. package/dist/esm/component/component.js +170 -0
  98. package/dist/esm/component/componentManager.d.ts +23 -0
  99. package/dist/esm/component/componentManager.js +45 -0
  100. package/dist/esm/component/dataLabels.d.ts +23 -0
  101. package/dist/esm/component/dataLabels.js +134 -0
  102. package/dist/esm/component/exportMenu.d.ts +38 -0
  103. package/dist/esm/component/exportMenu.js +147 -0
  104. package/dist/esm/component/gaugeSeries.d.ts +160 -0
  105. package/dist/esm/component/gaugeSeries.js +447 -0
  106. package/dist/esm/component/heatmapSeries.d.ts +64 -0
  107. package/dist/esm/component/heatmapSeries.js +152 -0
  108. package/dist/esm/component/hoveredSeries.d.ts +27 -0
  109. package/dist/esm/component/hoveredSeries.js +95 -0
  110. package/dist/esm/component/legend.d.ts +26 -0
  111. package/dist/esm/component/legend.js +149 -0
  112. package/dist/esm/component/lineSeries.d.ts +69 -0
  113. package/dist/esm/component/lineSeries.js +319 -0
  114. package/dist/esm/component/noDataText.d.ts +9 -0
  115. package/dist/esm/component/noDataText.js +31 -0
  116. package/dist/esm/component/pieSeries.d.ts +137 -0
  117. package/dist/esm/component/pieSeries.js +390 -0
  118. package/dist/esm/component/plot.d.ts +37 -0
  119. package/dist/esm/component/plot.js +163 -0
  120. package/dist/esm/component/radarSeries.d.ts +85 -0
  121. package/dist/esm/component/radarSeries.js +222 -0
  122. package/dist/esm/component/radialAxis.d.ts +26 -0
  123. package/dist/esm/component/radialAxis.js +210 -0
  124. package/dist/esm/component/radialBarSeries.d.ts +111 -0
  125. package/dist/esm/component/radialBarSeries.js +349 -0
  126. package/dist/esm/component/radialPlot.d.ts +55 -0
  127. package/dist/esm/component/radialPlot.js +188 -0
  128. package/dist/esm/component/rangeSelection.d.ts +61 -0
  129. package/dist/esm/component/rangeSelection.js +150 -0
  130. package/dist/esm/component/resetButton.d.ts +13 -0
  131. package/dist/esm/component/resetButton.js +26 -0
  132. package/dist/esm/component/scatterSeries.d.ts +34 -0
  133. package/dist/esm/component/scatterSeries.js +159 -0
  134. package/dist/esm/component/selectedSeries.d.ts +26 -0
  135. package/dist/esm/component/selectedSeries.js +109 -0
  136. package/dist/esm/component/spectrumLegend.d.ts +15 -0
  137. package/dist/esm/component/spectrumLegend.js +76 -0
  138. package/dist/esm/component/title.d.ts +12 -0
  139. package/dist/esm/component/title.js +53 -0
  140. package/dist/esm/component/tooltip.d.ts +41 -0
  141. package/dist/esm/component/tooltip.js +131 -0
  142. package/dist/esm/component/treemapSeries.d.ts +57 -0
  143. package/dist/esm/component/treemapSeries.js +191 -0
  144. package/dist/esm/component/zeroAxis.d.ts +9 -0
  145. package/dist/esm/component/zeroAxis.js +49 -0
  146. package/dist/esm/eventEmitter.d.ts +8 -0
  147. package/dist/esm/eventEmitter.js +15 -0
  148. package/dist/esm/helpers/arrayUtil.d.ts +10 -0
  149. package/dist/esm/helpers/arrayUtil.js +54 -0
  150. package/dist/esm/helpers/axes.d.ts +67 -0
  151. package/dist/esm/helpers/axes.js +345 -0
  152. package/dist/esm/helpers/boxSeries.d.ts +5 -0
  153. package/dist/esm/helpers/boxSeries.js +71 -0
  154. package/dist/esm/helpers/calculator.d.ts +19 -0
  155. package/dist/esm/helpers/calculator.js +153 -0
  156. package/dist/esm/helpers/color.d.ts +153 -0
  157. package/dist/esm/helpers/color.js +218 -0
  158. package/dist/esm/helpers/colorSpectrum.d.ts +5 -0
  159. package/dist/esm/helpers/colorSpectrum.js +17 -0
  160. package/dist/esm/helpers/coordinate.d.ts +9 -0
  161. package/dist/esm/helpers/coordinate.js +51 -0
  162. package/dist/esm/helpers/dataLabels.d.ts +36 -0
  163. package/dist/esm/helpers/dataLabels.js +405 -0
  164. package/dist/esm/helpers/dom.d.ts +2 -0
  165. package/dist/esm/helpers/dom.js +8 -0
  166. package/dist/esm/helpers/downloader.d.ts +7 -0
  167. package/dist/esm/helpers/downloader.js +287 -0
  168. package/dist/esm/helpers/formatDate.d.ts +16 -0
  169. package/dist/esm/helpers/formatDate.js +140 -0
  170. package/dist/esm/helpers/geometric.d.ts +3 -0
  171. package/dist/esm/helpers/geometric.js +35 -0
  172. package/dist/esm/helpers/googleAnalytics.d.ts +1 -0
  173. package/dist/esm/helpers/googleAnalytics.js +39 -0
  174. package/dist/esm/helpers/htmlSanitizer.d.ts +1 -0
  175. package/dist/esm/helpers/htmlSanitizer.js +86 -0
  176. package/dist/esm/helpers/legend.d.ts +9 -0
  177. package/dist/esm/helpers/legend.js +47 -0
  178. package/dist/esm/helpers/pieSeries.d.ts +15 -0
  179. package/dist/esm/helpers/pieSeries.js +72 -0
  180. package/dist/esm/helpers/plot.d.ts +2 -0
  181. package/dist/esm/helpers/plot.js +4 -0
  182. package/dist/esm/helpers/radarSeries.d.ts +1 -0
  183. package/dist/esm/helpers/radarSeries.js +7 -0
  184. package/dist/esm/helpers/range.d.ts +6 -0
  185. package/dist/esm/helpers/range.js +16 -0
  186. package/dist/esm/helpers/responders.d.ts +37 -0
  187. package/dist/esm/helpers/responders.js +197 -0
  188. package/dist/esm/helpers/sector.d.ts +55 -0
  189. package/dist/esm/helpers/sector.js +117 -0
  190. package/dist/esm/helpers/squarifier.d.ts +8 -0
  191. package/dist/esm/helpers/squarifier.js +110 -0
  192. package/dist/esm/helpers/style.d.ts +14 -0
  193. package/dist/esm/helpers/style.js +48 -0
  194. package/dist/esm/helpers/theme.d.ts +58 -0
  195. package/dist/esm/helpers/theme.js +557 -0
  196. package/dist/esm/helpers/tooltip.d.ts +2 -0
  197. package/dist/esm/helpers/tooltip.js +18 -0
  198. package/dist/esm/helpers/tooltipTemplate.d.ts +21 -0
  199. package/dist/esm/helpers/tooltipTemplate.js +147 -0
  200. package/dist/esm/helpers/utils.d.ts +42 -0
  201. package/dist/esm/helpers/utils.js +268 -0
  202. package/dist/esm/helpers/validation.d.ts +6 -0
  203. package/dist/esm/helpers/validation.js +16 -0
  204. package/dist/esm/index.d.ts +40 -0
  205. package/dist/esm/index.js +75 -0
  206. package/dist/esm/message.d.ts +11 -0
  207. package/dist/esm/message.js +11 -0
  208. package/dist/esm/painter.d.ts +27 -0
  209. package/dist/esm/painter.js +88 -0
  210. package/dist/esm/responderDetectors.d.ts +6 -0
  211. package/dist/esm/responderDetectors.js +124 -0
  212. package/dist/esm/scale/coordinateScaleCalculator.d.ts +24 -0
  213. package/dist/esm/scale/coordinateScaleCalculator.js +174 -0
  214. package/dist/esm/scale/datetimeScaleCalculator.d.ts +20 -0
  215. package/dist/esm/scale/datetimeScaleCalculator.js +59 -0
  216. package/dist/esm/store/axes.d.ts +30 -0
  217. package/dist/esm/store/axes.js +282 -0
  218. package/dist/esm/store/category.d.ts +4 -0
  219. package/dist/esm/store/category.js +73 -0
  220. package/dist/esm/store/colorValueScale.d.ts +3 -0
  221. package/dist/esm/store/colorValueScale.js +56 -0
  222. package/dist/esm/store/dataRange.d.ts +4 -0
  223. package/dist/esm/store/dataRange.js +170 -0
  224. package/dist/esm/store/gaugeAxes.d.ts +4 -0
  225. package/dist/esm/store/gaugeAxes.js +175 -0
  226. package/dist/esm/store/heatmapAxes.d.ts +3 -0
  227. package/dist/esm/store/heatmapAxes.js +98 -0
  228. package/dist/esm/store/heatmapSeriesData.d.ts +3 -0
  229. package/dist/esm/store/heatmapSeriesData.js +34 -0
  230. package/dist/esm/store/layout.d.ts +12 -0
  231. package/dist/esm/store/layout.js +487 -0
  232. package/dist/esm/store/legend.d.ts +3 -0
  233. package/dist/esm/store/legend.js +435 -0
  234. package/dist/esm/store/nestedPieSeriesData.d.ts +3 -0
  235. package/dist/esm/store/nestedPieSeriesData.js +49 -0
  236. package/dist/esm/store/options.d.ts +3 -0
  237. package/dist/esm/store/options.js +62 -0
  238. package/dist/esm/store/plot.d.ts +3 -0
  239. package/dist/esm/store/plot.js +102 -0
  240. package/dist/esm/store/radialAxes.d.ts +8 -0
  241. package/dist/esm/store/radialAxes.js +199 -0
  242. package/dist/esm/store/reactive.d.ts +11 -0
  243. package/dist/esm/store/reactive.js +196 -0
  244. package/dist/esm/store/root.d.ts +3 -0
  245. package/dist/esm/store/root.js +46 -0
  246. package/dist/esm/store/scale.d.ts +3 -0
  247. package/dist/esm/store/scale.js +102 -0
  248. package/dist/esm/store/seriesData.d.ts +3 -0
  249. package/dist/esm/store/seriesData.js +299 -0
  250. package/dist/esm/store/stackSeriesData.d.ts +8 -0
  251. package/dist/esm/store/stackSeriesData.js +192 -0
  252. package/dist/esm/store/store.d.ts +20 -0
  253. package/dist/esm/store/store.js +112 -0
  254. package/dist/esm/store/theme.d.ts +3 -0
  255. package/dist/esm/store/theme.js +139 -0
  256. package/dist/esm/store/treemapSeriesData.d.ts +4 -0
  257. package/dist/esm/store/treemapSeriesData.js +93 -0
  258. package/dist/td-chart.css +127 -0
  259. package/dist/td-chart.js +41463 -0
  260. package/dist/td-chart.min.css +6 -0
  261. package/dist/td-chart.min.js +9 -0
  262. package/package.json +112 -0
  263. package/types/brushes.d.ts +30 -0
  264. package/types/charts.d.ts +152 -0
  265. package/types/components/axis.d.ts +71 -0
  266. package/types/components/circleLegend.d.ts +9 -0
  267. package/types/components/dataLabels.d.ts +119 -0
  268. package/types/components/exportMenu.d.ts +14 -0
  269. package/types/components/legend.d.ts +27 -0
  270. package/types/components/plot.d.ts +8 -0
  271. package/types/components/radialAxis.d.ts +22 -0
  272. package/types/components/radialPlot.d.ts +11 -0
  273. package/types/components/rangeSelection.d.ts +3 -0
  274. package/types/components/resetButton.d.ts +13 -0
  275. package/types/components/series.d.ts +386 -0
  276. package/types/components/spectrumLegend.d.ts +25 -0
  277. package/types/components/tooltip.d.ts +58 -0
  278. package/types/components/zoom.d.ts +3 -0
  279. package/types/eventEmitter.d.ts +12 -0
  280. package/types/index.d.ts +615 -0
  281. package/types/options.d.ts +833 -0
  282. package/types/resizeObserver.d.ts +54 -0
  283. package/types/store/store.d.ts +564 -0
  284. package/types/theme.d.ts +670 -0
@@ -0,0 +1,279 @@
1
+ import Chart from "./chart";
2
+ import dataRange from "../store/dataRange";
3
+ import scale from "../store/scale";
4
+ import axes from "../store/axes";
5
+ import plot from "../store/plot";
6
+ import Tooltip from "../component/tooltip";
7
+ import Plot from "../component/plot";
8
+ import ScatterSeries from "../component/scatterSeries";
9
+ import Axis from "../component/axis";
10
+ import Legend from "../component/legend";
11
+ import Title from "../component/title";
12
+ import AxisTitle from "../component/axisTitle";
13
+ import ExportMenu from "../component/exportMenu";
14
+ import HoveredSeries from "../component/hoveredSeries";
15
+ import SelectedSeries from "../component/selectedSeries";
16
+ import Background from "../component/background";
17
+ import NoDataText from "../component/noDataText";
18
+ import * as basicBrush from "../brushes/basic";
19
+ import * as axisBrush from "../brushes/axis";
20
+ import * as legendBrush from "../brushes/legend";
21
+ import * as labelBrush from "../brushes/label";
22
+ import * as exportMenuBrush from "../brushes/exportMenu";
23
+ import * as scatterSeriesBrush from "../brushes/scatterSeries";
24
+ import { isNull } from "../helpers/utils";
25
+ import { getCoordinateXValue, getCoordinateYValue } from "../helpers/coordinate";
26
+ function clearUnnecessaryData(scatterSeries) {
27
+ return scatterSeries.map((series) => {
28
+ const exist = {};
29
+ return Object.assign(Object.assign({}, series), { data: series.data
30
+ .filter((datum) => !isNull(datum))
31
+ .reduce((acc, cur) => {
32
+ const x = getCoordinateXValue(cur);
33
+ const y = getCoordinateYValue(cur);
34
+ const key = `${x}-${y}`;
35
+ if (!exist[key]) {
36
+ exist[key] = true;
37
+ return [...acc, cur];
38
+ }
39
+ return acc;
40
+ }, []) });
41
+ });
42
+ }
43
+ /**
44
+ * @class
45
+ * @classdesc Scatter Chart
46
+ * @param {Object} props
47
+ * @param {HTMLElement} props.el - The target element to create chart.
48
+ * @param {Object} props.data - Data for making Scatter Chart.
49
+ * @param {Array<Object>} props.data.series - Series data.
50
+ * @param {string} props.data.series.name - Series name.
51
+ * @param {Array<Object|Array<number>>} props.data.series.data - Series data.
52
+ * @param {Object} [props.options] - Options for making Scatter Chart.
53
+ * @param {Object} [props.options.chart]
54
+ * @param {string|Object} [props.options.chart.title] - Chart title text or options.
55
+ * @param {string} [props.options.chart.title.text] - Chart title text.
56
+ * @param {number} [props.options.chart.title.offsetX] - Offset value to move title horizontally.
57
+ * @param {number} [props.options.chart.title.offsetY] - Offset value to move title vertically.
58
+ * @param {string} [props.options.chart.title.align] - Chart text align. 'left', 'right', 'center' is available.
59
+ * @param {boolean|Object} [props.options.chart.animation] - Whether to use animation and duration when rendering the initial chart.
60
+ * @param {number|string} [props.options.chart.width] - Chart width. 'auto' or if not write, the width of the parent container is followed. 'auto' or if not created, the width of the parent container is followed.
61
+ * @param {number|string} [props.options.chart.height] - Chart height. 'auto' or if not write, the width of the parent container is followed. 'auto' or if not created, the height of the parent container is followed.
62
+ * @param {Object} [props.options.series]
63
+ * @param {boolean} [props.options.series.selectable=false] - Whether to make selectable series or not.
64
+ * @param {Object} [props.options.xAxis]
65
+ * @param {string|Object} [props.options.xAxis.title] - Axis title.
66
+ * @param {boolean} [props.options.xAxis.rotateLabel=true] - Whether to allow axis label rotation.
67
+ * @param {boolean|Object} [props.options.xAxis.date] - Whether the x axis label is of date type. Format option used for date type. Whether the x axis label is of date type. If use date type, format option used for date type.
68
+ * @param {Object} [props.options.xAxis.tick] - Option to adjust tick interval.
69
+ * @param {Object} [props.options.xAxis.label] - Option to adjust label interval.
70
+ * @param {Object} [props.options.xAxis.scale] - Option to adjust axis minimum, maximum, step size.
71
+ * @param {number} [props.options.xAxis.width] - Width of xAxis.
72
+ * @param {number} [props.options.xAxis.height] - Height of xAxis.
73
+ * @param {Object} [props.options.yAxis]
74
+ * @param {string|Object} [props.options.yAxis.title] - Axis title.
75
+ * @param {Object} [props.options.yAxis.tick] - Option to adjust tick interval.
76
+ * @param {Object} [props.options.yAxis.label] - Option to adjust label interval.
77
+ * @param {Object} [props.options.yAxis.scale] - Option to adjust axis minimum, maximum, step size.
78
+ * @param {number} [props.options.yAxis.width] - Width of yAxis.
79
+ * @param {number} [props.options.yAxis.height] - Height of yAxis.
80
+ * @param {Object} [props.options.plot]
81
+ * @param {number} [props.options.plot.width] - Width of plot.
82
+ * @param {number} [props.options.plot.height] - Height of plot.
83
+ * @param {boolean} [props.options.plot.visible] - Whether to show plot line.
84
+ * @param {Object} [props.options.legend]
85
+ * @param {string} [props.options.legend.align] - Legend align. 'top', 'bottom', 'right', 'left' is available.
86
+ * @param {string} [props.options.legend.showCheckbox] - Whether to show checkbox.
87
+ * @param {boolean} [props.options.legend.visible] - Whether to show legend.
88
+ * @param {number} [props.options.legend.width] - Width of legend.
89
+ * @param {Object} [props.options.legend.item] - `width` and `overflow` options of the legend item. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Legend guide} on github.
90
+ * @param {Object} [props.options.exportMenu]
91
+ * @param {boolean} [props.options.exportMenu.visible] - Whether to show export menu.
92
+ * @param {string} [props.options.exportMenu.filename] - File name applied when downloading.
93
+ * @param {Object} [props.options.tooltip]
94
+ * @param {number} [props.options.tooltip.offsetX] - Offset value to move title horizontally.
95
+ * @param {number} [props.options.tooltip.offsetY] - Offset value to move title vertically.
96
+ * @param {Function} [props.options.tooltip.formatter] - Function to format data value.
97
+ * @param {Function} [props.options.tooltip.template] - Function to create custom template. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Tooltip guide} on github.
98
+ * @param {Object} [props.options.responsive] - Rules for changing chart options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Responsive guide} on github.
99
+ * @param {boolean|Object} [props.options.responsive.animation] - Animation duration when the chart is modified.
100
+ * @param {Array<Object>} [props.options.responsive.rules] - Rules for the Chart to Respond.
101
+ * @param {Object} [props.options.lang] - Options for changing the text displayed on the chart or i18n languages.
102
+ * @param {Object} [props.options.lang.noData] - No Data Layer Text.
103
+ * @param {Object} [props.options.theme] - Chart theme options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Scattter Chart guide} on github.
104
+ * @param {Object} [props.options.theme.chart] - Chart font theme.
105
+ * @param {Object} [props.options.theme.noData] - No Data Layer Text theme.
106
+ * @param {Object} [props.options.theme.series] - Series theme.
107
+ * @param {Object} [props.options.theme.title] - Title theme.
108
+ * @param {Object} [props.options.theme.xAxis] - X Axis theme.
109
+ * @param {Object} [props.options.theme.yAxis] - Y Axis theme.
110
+ * @param {Object} [props.options.theme.legend] - Legend theme.
111
+ * @param {Object} [props.options.theme.tooltip] - Tooltip theme.
112
+ * @param {Object} [props.options.theme.plot] - Plot theme.
113
+ * @param {Object} [props.options.theme.exportMenu] - ExportMenu theme.
114
+ * @extends Chart
115
+ */
116
+ export default class ScatterChart extends Chart {
117
+ constructor(props) {
118
+ var _a;
119
+ super({
120
+ el: props.el,
121
+ options: props.options,
122
+ series: {
123
+ scatter: clearUnnecessaryData(props.data.series),
124
+ },
125
+ categories: (_a = props.data) === null || _a === void 0 ? void 0 : _a.categories,
126
+ modules: [dataRange, scale, axes, plot],
127
+ });
128
+ }
129
+ initialize() {
130
+ super.initialize();
131
+ this.componentManager.add(Background);
132
+ this.componentManager.add(Title);
133
+ this.componentManager.add(Plot);
134
+ this.componentManager.add(Legend);
135
+ this.componentManager.add(ScatterSeries);
136
+ this.componentManager.add(Axis, { name: 'xAxis' });
137
+ this.componentManager.add(Axis, { name: 'yAxis' });
138
+ this.componentManager.add(AxisTitle, { name: 'xAxis' });
139
+ this.componentManager.add(AxisTitle, { name: 'yAxis' });
140
+ this.componentManager.add(ExportMenu, { chartEl: this.el });
141
+ this.componentManager.add(HoveredSeries);
142
+ this.componentManager.add(SelectedSeries);
143
+ this.componentManager.add(Tooltip, { chartEl: this.el });
144
+ this.componentManager.add(NoDataText);
145
+ this.painter.addGroups([
146
+ basicBrush,
147
+ axisBrush,
148
+ legendBrush,
149
+ labelBrush,
150
+ exportMenuBrush,
151
+ scatterSeriesBrush,
152
+ ]);
153
+ }
154
+ /**
155
+ * Add data.
156
+ * @param {Array<Object>} data - Array of data to be added.
157
+ * @api
158
+ * @example
159
+ * chart.addData([
160
+ * {x: 10, y: 20},
161
+ * {x: 30, y: 40},
162
+ * ]);
163
+ */
164
+ addData(data) {
165
+ this.animationControlFlag.updating = true;
166
+ this.resetSeries();
167
+ this.store.dispatch('addData', { data });
168
+ }
169
+ /**
170
+ * Add series.
171
+ * @param {Object} data - Data to be added.
172
+ * @param {string} data.name - Series name.
173
+ * @param {Array} data.data - Array of data to be added.
174
+ * @api
175
+ * @example
176
+ * chart.addSeries({
177
+ * name: 'newSeries',
178
+ * data: [
179
+ * {x: 10, y: 20},
180
+ * {x: 30, y: 40},
181
+ * ],
182
+ * });
183
+ */
184
+ addSeries(data) {
185
+ this.resetSeries();
186
+ this.store.dispatch('addSeries', { data });
187
+ }
188
+ /**
189
+ * Convert the chart data to new data.
190
+ * @param {Object} data - Data to be set.
191
+ * @api
192
+ * @example
193
+ * chart.setData({
194
+ * series: [
195
+ * {
196
+ * name: 'name'
197
+ * data: [
198
+ * {x: 10, y: 20},
199
+ * {x: 30, y: 40},
200
+ * ]
201
+ * }
202
+ * ]
203
+ * });
204
+ */
205
+ setData(data) {
206
+ const { categories, series } = data;
207
+ this.resetSeries();
208
+ this.store.dispatch('setData', { series: { scatter: series }, categories });
209
+ }
210
+ /**
211
+ * Convert the chart options to new options.
212
+ * @param {Object} options - Chart options
213
+ * @api
214
+ * @example
215
+ * chart.setOptions({
216
+ * chart: {
217
+ * width: 500,
218
+ * height: 'auto',
219
+ * title: 'Energy Usage',
220
+ * },
221
+ * xAxis: {
222
+ * title: 'Month',
223
+ * },
224
+ * yAxis: {
225
+ * title: 'Energy (kWh)',
226
+ * },
227
+ * series: {
228
+ * selectable: true,
229
+ * },
230
+ * tooltip: {
231
+ * formatter: (value) => `${value}kWh`,
232
+ * },
233
+ * });
234
+ */
235
+ setOptions(options) {
236
+ this.resetSeries();
237
+ this.dispatchOptionsEvent('initOptions', options);
238
+ }
239
+ /**
240
+ * Update chart options.
241
+ * @param {Object} options - Chart options
242
+ * @api
243
+ * @example
244
+ * chart.updateOptions({
245
+ * chart: {
246
+ * height: 'auto',
247
+ * title: 'Energy Usage',
248
+ * },
249
+ * tooltip: {
250
+ * formatter: (value) => `${value}kWh`,
251
+ * },
252
+ * });
253
+ */
254
+ updateOptions(options) {
255
+ this.resetSeries();
256
+ this.dispatchOptionsEvent('updateOptions', options);
257
+ }
258
+ /**
259
+ * Show tooltip.
260
+ * @param {Object} seriesInfo - Information of the series for the tooltip to be displayed.
261
+ * @param {number} seriesInfo.seriesIndex - Index of series.
262
+ * @param {number} seriesInfo.index - Index of data within series.
263
+ * @api
264
+ * @example
265
+ * chart.showTooltip({index: 1, seriesIndex: 2});
266
+ */
267
+ showTooltip(seriesInfo) {
268
+ this.eventBus.emit('showTooltip', Object.assign(Object.assign({}, seriesInfo), { state: this.store.state }));
269
+ }
270
+ /**
271
+ * Hide tooltip.
272
+ * @api
273
+ * @example
274
+ * chart.hideTooltip();
275
+ */
276
+ hideTooltip() {
277
+ this.eventBus.emit('hideTooltip');
278
+ }
279
+ }
@@ -0,0 +1,166 @@
1
+ import Chart from "./chart";
2
+ import { TreemapChartOptions, TreemapSeriesData, TreemapSeriesType } from "../../types/options";
3
+ import { TreemapChartProps, AddSeriesDataInfo, SelectSeriesInfo } from "../../types/charts";
4
+ /**
5
+ * @class
6
+ * @classdesc Treemap Chart
7
+ * @param {Object} props
8
+ * @param {HTMLElement} props.el - The target element to create chart.
9
+ * @param {Object} props.data - Data for making Treemap Chart.
10
+ * @param {Array<string>} props.data.categories - Categories.
11
+ * @param {Array<Object>} props.data.series - Series data.
12
+ * @param {string} props.data.series.label - Data name.
13
+ * @param {number} [props.data.series.data] - data value.
14
+ * @param {number} [props.data.series.colorValue] - color value. If you use the useColorValue option, the color is painted based on this value.
15
+ * @param {Array<Object>} [props.data.series.children] - Child element value.
16
+ * @param {Object} [props.options] - Options for making Treemap Chart.
17
+ * @param {Object} [props.options.chart]
18
+ * @param {string|Object} [props.options.chart.title] - Chart title text or options.
19
+ * @param {string} [props.options.chart.title.text] - Chart title text.
20
+ * @param {number} [props.options.chart.title.offsetX] - Offset value to move title horizontally.
21
+ * @param {number} [props.options.chart.title.offsetY] - Offset value to move title vertically.
22
+ * @param {string} [props.options.chart.title.align] - Chart text align. 'left', 'right', 'center' is available.
23
+ * @param {boolean|Object} [props.options.chart.animation] - Whether to use animation and duration when rendering the initial chart.
24
+ * @param {number|string} [props.options.chart.width] - Chart width. 'auto' or if not write, the width of the parent container is followed. 'auto' or if not created, the width of the parent container is followed.
25
+ * @param {number|string} [props.options.chart.height] - Chart height. 'auto' or if not write, the width of the parent container is followed. 'auto' or if not created, the height of the parent container is followed.
26
+ * @param {Object} [props.options.series]
27
+ * @param {boolean} [props.options.series.selectable=false] - Whether to make selectable series or not.
28
+ * @param {boolean} [props.options.series.useColorValue] - Whether to use color value or not.
29
+ * @param {boolean} [props.options.series.zoomable] - Whether to use zoom feature or not.
30
+ * @param {Object} [props.options.series.dataLabels] - Set the visibility, location, and formatting of dataLabel. For specific information, refer to the {@link https://github.com/nhn/tui.chart|DataLabels guide} on github.
31
+ * @param {Object} [props.options.legend]
32
+ * @param {string} [props.options.legend.align] - Legend align. 'top', 'bottom', 'right', 'left' is available.
33
+ * @param {boolean} [props.options.legend.visible=false] - Whether to show legend.
34
+ * @param {number} [props.options.legend.width] - Width of legend.
35
+ * @param {Object} [props.options.exportMenu]
36
+ * @param {boolean} [props.options.exportMenu.visible] - Whether to show export menu.
37
+ * @param {string} [props.options.exportMenu.filename] - File name applied when downloading.
38
+ * @param {Object} [props.options.tooltip]
39
+ * @param {number} [props.options.tooltip.offsetX] - Offset value to move title horizontally.
40
+ * @param {number} [props.options.tooltip.offsetY] - Offset value to move title vertically.
41
+ * @param {Function} [props.options.tooltip.formatter] - Function to format data value.
42
+ * @param {Function} [props.options.tooltip.template] - Function to create custom template. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Tooltip guide} on github.
43
+ * @param {Object} [props.options.responsive] - Rules for changing chart options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Responsive guide} on github.
44
+ * @param {boolean|Object} [props.options.responsive.animation] - Animation duration when the chart is modified.
45
+ * @param {Array<Object>} [props.options.responsive.rules] - Rules for the Chart to Respond.
46
+ * @param {Object} [props.options.lang] - Options for changing the text displayed on the chart or i18n languages.
47
+ * @param {Object} [props.options.lang.noData] - No Data Layer Text.
48
+ * @param {Object} [props.options.theme] - Chart theme options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Treemap Chart guide} on github.
49
+ * @param {Object} [props.options.theme.chart] - Chart font theme.
50
+ * @param {Object} [props.options.theme.noData] - No Data Layer Text theme.
51
+ * @param {Object} [props.options.theme.series] - Series theme.
52
+ * @param {Object} [props.options.theme.title] - Title theme.
53
+ * @param {Object} [props.options.theme.legend] - Legend theme.
54
+ * @param {Object} [props.options.theme.tooltip] - Tooltip theme.
55
+ * @param {Object} [props.options.theme.plot] - Plot theme.
56
+ * @param {Object} [props.options.theme.exportMenu] - ExportMenu theme.
57
+ * @extends Chart
58
+ */
59
+ export default class TreemapChart extends Chart<TreemapChartOptions> {
60
+ constructor(props: TreemapChartProps);
61
+ protected initialize(): void;
62
+ /**
63
+ * Add series.
64
+ * @param {Object} data - Data to be added.
65
+ * @param {string} data.name - Series name.
66
+ * @param {Array<Object>} data.data - Array of data to be added.
67
+ * @api
68
+ * @example
69
+ * chart.addSeries({
70
+ * label: 'Documents',
71
+ * children: [
72
+ * {label: 'A', data: 20},
73
+ * {label: 'B', data: 40},
74
+ * ],
75
+ * });
76
+ */
77
+ addSeries(data: TreemapSeriesType, dataInfo?: AddSeriesDataInfo): void;
78
+ /**
79
+ * Convert the chart data to new data.
80
+ * @param {Object} data - Data to be set.
81
+ * @api
82
+ * @example
83
+ * chart.setData(
84
+ * series: [
85
+ * {
86
+ * label: 'Documents',
87
+ * children: [
88
+ * {label: 'A', data: 20},
89
+ * {label: 'B', data: 40},
90
+ * ],
91
+ * },
92
+ * {
93
+ * label: 'Documents',
94
+ * data: 30,
95
+ * }
96
+ * ]
97
+ * );
98
+ */
99
+ setData(data: TreemapSeriesData): void;
100
+ /**
101
+ * Hide series data label.
102
+ * @api
103
+ * @example
104
+ * chart.hideSeriesDataLabel();
105
+ */
106
+ hideSeriesDataLabel(): void;
107
+ /**
108
+ * Show series data label.
109
+ * @api
110
+ * @example
111
+ * chart.showSeriesDataLabel();
112
+ */
113
+ showSeriesDataLabel(): void;
114
+ /**
115
+ * Convert the chart options to new options.
116
+ * @param {Object} options - Chart options
117
+ * @api
118
+ * @example
119
+ * chart.setOptions({
120
+ * chart: {
121
+ * width: 500,
122
+ * height: 'auto',
123
+ * title: 'Energy Usage',
124
+ * },
125
+ * series: {
126
+ * selectable: true,
127
+ * },
128
+ * tooltip: {
129
+ * formatter: (value) => `${value}kWh`,
130
+ * },
131
+ * });
132
+ */
133
+ setOptions(options: TreemapChartOptions): void;
134
+ /**
135
+ * Update chart options.
136
+ * @param {Object} options - Chart options
137
+ * @api
138
+ * @example
139
+ * chart.updateOptions({
140
+ * chart: {
141
+ * height: 'auto',
142
+ * title: 'Energy Usage',
143
+ * },
144
+ * tooltip: {
145
+ * formatter: (value) => `${value}kWh`,
146
+ * },
147
+ * });
148
+ */
149
+ updateOptions(options: TreemapChartOptions): void;
150
+ /**
151
+ * Show tooltip.
152
+ * @param {Object} seriesInfo - Information of the series for the tooltip to be displayed.
153
+ * @param {number} seriesInfo.seriesIndex - Index of series.
154
+ * @api
155
+ * @example
156
+ * chart.showTooltip({seriesIndex: 1});
157
+ */
158
+ showTooltip(seriesInfo: SelectSeriesInfo): void;
159
+ /**
160
+ * Hide tooltip.
161
+ * @api
162
+ * @example
163
+ * chart.hideTooltip();
164
+ */
165
+ hideTooltip(): void;
166
+ }
@@ -0,0 +1,239 @@
1
+ import Chart from "./chart";
2
+ import colorValueScale from "../store/colorValueScale";
3
+ import treemapSeriesData from "../store/treemapSeriesData";
4
+ import Tooltip from "../component/tooltip";
5
+ import Title from "../component/title";
6
+ import ExportMenu from "../component/exportMenu";
7
+ import HoveredSeries from "../component/hoveredSeries";
8
+ import DataLabels from "../component/dataLabels";
9
+ import TreemapSeries from "../component/treemapSeries";
10
+ import SpectrumLegend from "../component/spectrumLegend";
11
+ import BackButton from "../component/backButton";
12
+ import SelectedSeries from "../component/selectedSeries";
13
+ import Background from "../component/background";
14
+ import NoDataText from "../component/noDataText";
15
+ import * as basicBrush from "../brushes/basic";
16
+ import * as legendBrush from "../brushes/legend";
17
+ import * as labelBrush from "../brushes/label";
18
+ import * as exportMenuBrush from "../brushes/exportMenu";
19
+ import * as dataLabelBrush from "../brushes/dataLabel";
20
+ import * as spectrumLegendBrush from "../brushes/spectrumLegend";
21
+ import * as resetButtonBrush from "../brushes/resetButton";
22
+ /**
23
+ * @class
24
+ * @classdesc Treemap Chart
25
+ * @param {Object} props
26
+ * @param {HTMLElement} props.el - The target element to create chart.
27
+ * @param {Object} props.data - Data for making Treemap Chart.
28
+ * @param {Array<string>} props.data.categories - Categories.
29
+ * @param {Array<Object>} props.data.series - Series data.
30
+ * @param {string} props.data.series.label - Data name.
31
+ * @param {number} [props.data.series.data] - data value.
32
+ * @param {number} [props.data.series.colorValue] - color value. If you use the useColorValue option, the color is painted based on this value.
33
+ * @param {Array<Object>} [props.data.series.children] - Child element value.
34
+ * @param {Object} [props.options] - Options for making Treemap Chart.
35
+ * @param {Object} [props.options.chart]
36
+ * @param {string|Object} [props.options.chart.title] - Chart title text or options.
37
+ * @param {string} [props.options.chart.title.text] - Chart title text.
38
+ * @param {number} [props.options.chart.title.offsetX] - Offset value to move title horizontally.
39
+ * @param {number} [props.options.chart.title.offsetY] - Offset value to move title vertically.
40
+ * @param {string} [props.options.chart.title.align] - Chart text align. 'left', 'right', 'center' is available.
41
+ * @param {boolean|Object} [props.options.chart.animation] - Whether to use animation and duration when rendering the initial chart.
42
+ * @param {number|string} [props.options.chart.width] - Chart width. 'auto' or if not write, the width of the parent container is followed. 'auto' or if not created, the width of the parent container is followed.
43
+ * @param {number|string} [props.options.chart.height] - Chart height. 'auto' or if not write, the width of the parent container is followed. 'auto' or if not created, the height of the parent container is followed.
44
+ * @param {Object} [props.options.series]
45
+ * @param {boolean} [props.options.series.selectable=false] - Whether to make selectable series or not.
46
+ * @param {boolean} [props.options.series.useColorValue] - Whether to use color value or not.
47
+ * @param {boolean} [props.options.series.zoomable] - Whether to use zoom feature or not.
48
+ * @param {Object} [props.options.series.dataLabels] - Set the visibility, location, and formatting of dataLabel. For specific information, refer to the {@link https://github.com/nhn/tui.chart|DataLabels guide} on github.
49
+ * @param {Object} [props.options.legend]
50
+ * @param {string} [props.options.legend.align] - Legend align. 'top', 'bottom', 'right', 'left' is available.
51
+ * @param {boolean} [props.options.legend.visible=false] - Whether to show legend.
52
+ * @param {number} [props.options.legend.width] - Width of legend.
53
+ * @param {Object} [props.options.exportMenu]
54
+ * @param {boolean} [props.options.exportMenu.visible] - Whether to show export menu.
55
+ * @param {string} [props.options.exportMenu.filename] - File name applied when downloading.
56
+ * @param {Object} [props.options.tooltip]
57
+ * @param {number} [props.options.tooltip.offsetX] - Offset value to move title horizontally.
58
+ * @param {number} [props.options.tooltip.offsetY] - Offset value to move title vertically.
59
+ * @param {Function} [props.options.tooltip.formatter] - Function to format data value.
60
+ * @param {Function} [props.options.tooltip.template] - Function to create custom template. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Tooltip guide} on github.
61
+ * @param {Object} [props.options.responsive] - Rules for changing chart options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Responsive guide} on github.
62
+ * @param {boolean|Object} [props.options.responsive.animation] - Animation duration when the chart is modified.
63
+ * @param {Array<Object>} [props.options.responsive.rules] - Rules for the Chart to Respond.
64
+ * @param {Object} [props.options.lang] - Options for changing the text displayed on the chart or i18n languages.
65
+ * @param {Object} [props.options.lang.noData] - No Data Layer Text.
66
+ * @param {Object} [props.options.theme] - Chart theme options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Treemap Chart guide} on github.
67
+ * @param {Object} [props.options.theme.chart] - Chart font theme.
68
+ * @param {Object} [props.options.theme.noData] - No Data Layer Text theme.
69
+ * @param {Object} [props.options.theme.series] - Series theme.
70
+ * @param {Object} [props.options.theme.title] - Title theme.
71
+ * @param {Object} [props.options.theme.legend] - Legend theme.
72
+ * @param {Object} [props.options.theme.tooltip] - Tooltip theme.
73
+ * @param {Object} [props.options.theme.plot] - Plot theme.
74
+ * @param {Object} [props.options.theme.exportMenu] - ExportMenu theme.
75
+ * @extends Chart
76
+ */
77
+ export default class TreemapChart extends Chart {
78
+ constructor(props) {
79
+ super({
80
+ el: props.el,
81
+ options: props.options,
82
+ series: {
83
+ treemap: props.data.series,
84
+ },
85
+ modules: [treemapSeriesData, colorValueScale],
86
+ });
87
+ }
88
+ initialize() {
89
+ super.initialize();
90
+ this.componentManager.add(Background);
91
+ this.componentManager.add(Title);
92
+ this.componentManager.add(SpectrumLegend);
93
+ this.componentManager.add(TreemapSeries);
94
+ this.componentManager.add(ExportMenu, { chartEl: this.el });
95
+ this.componentManager.add(HoveredSeries);
96
+ this.componentManager.add(SelectedSeries);
97
+ this.componentManager.add(DataLabels);
98
+ this.componentManager.add(Tooltip, { chartEl: this.el });
99
+ this.componentManager.add(BackButton);
100
+ this.componentManager.add(NoDataText);
101
+ this.painter.addGroups([
102
+ basicBrush,
103
+ legendBrush,
104
+ labelBrush,
105
+ exportMenuBrush,
106
+ dataLabelBrush,
107
+ spectrumLegendBrush,
108
+ resetButtonBrush,
109
+ ]);
110
+ }
111
+ /**
112
+ * Add series.
113
+ * @param {Object} data - Data to be added.
114
+ * @param {string} data.name - Series name.
115
+ * @param {Array<Object>} data.data - Array of data to be added.
116
+ * @api
117
+ * @example
118
+ * chart.addSeries({
119
+ * label: 'Documents',
120
+ * children: [
121
+ * {label: 'A', data: 20},
122
+ * {label: 'B', data: 40},
123
+ * ],
124
+ * });
125
+ */
126
+ addSeries(data, dataInfo) {
127
+ this.resetSeries();
128
+ this.store.dispatch('addTreemapSeries', Object.assign({ data }, dataInfo));
129
+ }
130
+ /**
131
+ * Convert the chart data to new data.
132
+ * @param {Object} data - Data to be set.
133
+ * @api
134
+ * @example
135
+ * chart.setData(
136
+ * series: [
137
+ * {
138
+ * label: 'Documents',
139
+ * children: [
140
+ * {label: 'A', data: 20},
141
+ * {label: 'B', data: 40},
142
+ * ],
143
+ * },
144
+ * {
145
+ * label: 'Documents',
146
+ * data: 30,
147
+ * }
148
+ * ]
149
+ * );
150
+ */
151
+ setData(data) {
152
+ this.resetSeries();
153
+ this.store.dispatch('setData', { series: { treemap: data.series } });
154
+ }
155
+ /**
156
+ * Hide series data label.
157
+ * @api
158
+ * @example
159
+ * chart.hideSeriesDataLabel();
160
+ */
161
+ hideSeriesDataLabel() {
162
+ this.store.dispatch('updateOptions', {
163
+ options: { series: { dataLabels: { visible: false } } },
164
+ });
165
+ }
166
+ /**
167
+ * Show series data label.
168
+ * @api
169
+ * @example
170
+ * chart.showSeriesDataLabel();
171
+ */
172
+ showSeriesDataLabel() {
173
+ this.store.dispatch('updateOptions', {
174
+ options: { series: { dataLabels: { visible: true } } },
175
+ });
176
+ }
177
+ /**
178
+ * Convert the chart options to new options.
179
+ * @param {Object} options - Chart options
180
+ * @api
181
+ * @example
182
+ * chart.setOptions({
183
+ * chart: {
184
+ * width: 500,
185
+ * height: 'auto',
186
+ * title: 'Energy Usage',
187
+ * },
188
+ * series: {
189
+ * selectable: true,
190
+ * },
191
+ * tooltip: {
192
+ * formatter: (value) => `${value}kWh`,
193
+ * },
194
+ * });
195
+ */
196
+ setOptions(options) {
197
+ this.resetSeries();
198
+ this.dispatchOptionsEvent('initOptions', options);
199
+ }
200
+ /**
201
+ * Update chart options.
202
+ * @param {Object} options - Chart options
203
+ * @api
204
+ * @example
205
+ * chart.updateOptions({
206
+ * chart: {
207
+ * height: 'auto',
208
+ * title: 'Energy Usage',
209
+ * },
210
+ * tooltip: {
211
+ * formatter: (value) => `${value}kWh`,
212
+ * },
213
+ * });
214
+ */
215
+ updateOptions(options) {
216
+ this.resetSeries();
217
+ this.dispatchOptionsEvent('updateOptions', options);
218
+ }
219
+ /**
220
+ * Show tooltip.
221
+ * @param {Object} seriesInfo - Information of the series for the tooltip to be displayed.
222
+ * @param {number} seriesInfo.seriesIndex - Index of series.
223
+ * @api
224
+ * @example
225
+ * chart.showTooltip({seriesIndex: 1});
226
+ */
227
+ showTooltip(seriesInfo) {
228
+ this.eventBus.emit('showTooltip', Object.assign(Object.assign({}, seriesInfo), { state: this.store.state }));
229
+ }
230
+ /**
231
+ * Hide tooltip.
232
+ * @api
233
+ * @example
234
+ * chart.hideTooltip();
235
+ */
236
+ hideTooltip() {
237
+ this.eventBus.emit('hideTooltip');
238
+ }
239
+ }