@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,386 @@
1
+ import Chart from "./chart";
2
+ import stackSeriesData from "../store/stackSeriesData";
3
+ import plot from "../store/plot";
4
+ import axes from "../store/axes";
5
+ import scale from "../store/scale";
6
+ import dataRange from "../store/dataRange";
7
+ import Legend from "../component/legend";
8
+ import BoxStackSeries from "../component/boxStackSeries";
9
+ import BoxSeries from "../component/boxSeries";
10
+ import LineSeries from "../component/lineSeries";
11
+ import Plot from "../component/plot";
12
+ import Title from "../component/title";
13
+ import ZeroAxis from "../component/zeroAxis";
14
+ import Axis from "../component/axis";
15
+ import AxisTitle from "../component/axisTitle";
16
+ import ExportMenu from "../component/exportMenu";
17
+ import SelectedSeries from "../component/selectedSeries";
18
+ import HoveredSeries from "../component/hoveredSeries";
19
+ import DataLabels from "../component/dataLabels";
20
+ import Tooltip from "../component/tooltip";
21
+ import Background from "../component/background";
22
+ import RangeSelection from "../component/rangeSelection";
23
+ import NoDataText from "../component/noDataText";
24
+ import * as basicBrush from "../brushes/basic";
25
+ import * as axisBrush from "../brushes/axis";
26
+ import * as legendBrush from "../brushes/legend";
27
+ import * as labelBrush from "../brushes/label";
28
+ import * as exportMenuBrush from "../brushes/exportMenu";
29
+ import * as dataLabelBrush from "../brushes/dataLabel";
30
+ import * as lineSeriesBrush from "../brushes/lineSeries";
31
+ import { isExist } from "../helpers/utils";
32
+ function hasPointEventType(respondersModel, name) {
33
+ return respondersModel.find(({ component }) => component.name === name && component.eventDetectType === 'point');
34
+ }
35
+ function hasColumnLineUsingPointEventType(respondersModel) {
36
+ return (isExist(hasPointEventType(respondersModel, 'column')) &&
37
+ isExist(hasPointEventType(respondersModel, 'line')));
38
+ }
39
+ /**
40
+ * @class
41
+ * @classdesc ColumnLine Chart
42
+ * @param {Object} props
43
+ * @param {HTMLElement} props.el - The target element to create chart.
44
+ * @param {Object} props.data - Data for making ColumnLine Chart.
45
+ * @param {Array<string>} props.data.categories - Categories.
46
+ * @param {Array<Object>} props.data.series - Series data.
47
+ * @param {Array<Object>} props.data.series.line - Line series data. Coordinate types data is not possible.
48
+ * @param {Array<Object>} props.data.series.column - Column series data.
49
+ * @param {Object} [props.options] - Options for making ColumnLine Chart.
50
+ * @param {Object} [props.options.chart]
51
+ * @param {string|Object} [props.options.chart.title] - Chart title text or options.
52
+ * @param {string} [props.options.chart.title.text] - Chart title text.
53
+ * @param {number} [props.options.chart.title.offsetX] - Offset value to move title horizontally.
54
+ * @param {number} [props.options.chart.title.offsetY] - Offset value to move title vertically.
55
+ * @param {string} [props.options.chart.title.align] - Chart text align. 'left', 'right', 'center' is available.
56
+ * @param {boolean|Object} [props.options.chart.animation] - Whether to use animation and duration when rendering the initial chart.
57
+ * @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.
58
+ * @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.
59
+ * @param {Object} [props.options.series] - Write common options in the upper depth and separate options to be applied to each chart.
60
+ * @param {Object} [props.options.series.line] - Options to be applied to the line chart. 'spline', 'showDot', 'dataLabels' is available. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Line Chart guide} on github.
61
+ * @param {Object} [props.options.series.column] - Options to be applied to the column chart. 'barWidth', 'stack', 'dataLabels' is available. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Column Chart guide} on github.
62
+ * @param {boolean} [props.options.series.selectable=false] - Whether to make selectable series or not.
63
+ * @param {boolean} [props.options.series.rangeSelectable=false] - Whether to use range selection feature or not.
64
+ * @param {string} [props.options.series.eventDetectType] - Event detect type. 'near', 'nearest', 'grouped', 'point' is available.
65
+ * @param {boolean} [props.options.series.shift=false] - Whether to use shift when addData or not.
66
+ * @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.
67
+ * @param {Object} [props.options.xAxis]
68
+ * @param {string|Object} [props.options.xAxis.title] - Axis title.
69
+ * @param {boolean} [props.options.xAxis.pointOnColumn=false] - Whether to move the start of the chart to the center of the column.
70
+ * @param {boolean} [props.options.xAxis.rotateLabel=true] - Whether to allow axis label rotation.
71
+ * @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.
72
+ * @param {Object} [props.options.xAxis.tick] - Option to adjust tick interval.
73
+ * @param {Object} [props.options.xAxis.label] - Option to adjust label interval.
74
+ * @param {Object} [props.options.xAxis.scale] - Option to adjust axis minimum, maximum, step size.
75
+ * @param {number} [props.options.xAxis.width] - Width of xAxis.
76
+ * @param {number} [props.options.xAxis.height] - Height of xAxis.
77
+ * @param {Object|Array<Object>} [props.options.yAxis] - If this option is an array type, use the secondary y axis.
78
+ * @param {string|Object} [props.options.yAxis.title] - Axis title.
79
+ * @param {Object} [props.options.yAxis.tick] - Option to adjust tick interval.
80
+ * @param {Object} [props.options.yAxis.label] - Option to adjust label interval.
81
+ * @param {Object} [props.options.yAxis.scale] - Option to adjust axis minimum, maximum, step size.
82
+ * @param {number} [props.options.yAxis.width] - Width of yAxis.
83
+ * @param {number} [props.options.yAxis.height] - Height of yAxis.
84
+ * @param {Object} [props.options.plot]
85
+ * @param {number} [props.options.plot.width] - Width of plot.
86
+ * @param {number} [props.options.plot.height] - Height of plot.
87
+ * @param {boolean} [props.options.plot.visible] - Whether to show plot line.
88
+ * @param {Array<Object>} [props.options.plot.lines] - Plot lines information. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Plot guide} on github.
89
+ * @param {Array<Object>} [props.options.plot.bands] - Plot bands information. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Plot guide} on github.
90
+ * @param {Object} [props.options.legend]
91
+ * @param {string} [props.options.legend.align] - Legend align. 'top', 'bottom', 'right', 'left' is available.
92
+ * @param {string} [props.options.legend.showCheckbox] - Whether to show checkbox.
93
+ * @param {boolean} [props.options.legend.visible] - Whether to show legend.
94
+ * @param {number} [props.options.legend.width] - Width of legend.
95
+ * @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.
96
+ * @param {Object} [props.options.exportMenu]
97
+ * @param {boolean} [props.options.exportMenu.visible] - Whether to show export menu.
98
+ * @param {string} [props.options.exportMenu.filename] - File name applied when downloading.
99
+ * @param {Object} [props.options.tooltip]
100
+ * @param {number} [props.options.tooltip.offsetX] - Offset value to move title horizontally.
101
+ * @param {number} [props.options.tooltip.offsetY] - Offset value to move title vertically.
102
+ * @param {Function} [props.options.tooltip.formatter] - Function to format data value.
103
+ * @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.
104
+ * @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.
105
+ * @param {boolean|Object} [props.options.responsive.animation] - Animation duration when the chart is modified.
106
+ * @param {Array<Object>} [props.options.responsive.rules] - Rules for the Chart to Respond.
107
+ * @param {Object} [props.options.lang] - Options for changing the text displayed on the chart or i18n languages.
108
+ * @param {Object} [props.options.lang.noData] - No Data Layer Text.
109
+ * @param {Object} [props.options.theme] - Chart theme options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|ColumnLine Chart guide} on github.
110
+ * @param {Object} [props.options.theme.chart] - Chart font theme.
111
+ * @param {Object} [props.options.theme.noData] - No Data Layer Text theme.
112
+ * @param {Object} [props.options.theme.series] - Series theme. Each theme to be applied to the two charts should be written separately.
113
+ * @param {Object} [props.options.theme.title] - Title theme.
114
+ * @param {Object} [props.options.theme.xAxis] - X Axis theme.
115
+ * @param {Object|Array<Object>} [props.options.theme.yAxis] - Y Axis theme. In the case of an arrangement, the first is the main axis and the second is the theme for the secondary axis.
116
+ * @param {Object} [props.options.theme.legend] - Legend theme.
117
+ * @param {Object} [props.options.theme.tooltip] - Tooltip theme.
118
+ * @param {Object} [props.options.theme.plot] - Plot theme.
119
+ * @param {Object} [props.options.theme.exportMenu] - ExportMenu theme.
120
+ * @extends Chart
121
+ */
122
+ export default class ColumnLineChart extends Chart {
123
+ constructor({ el, options, data: { series, categories } }) {
124
+ super({
125
+ el,
126
+ options,
127
+ series: series,
128
+ categories,
129
+ modules: [stackSeriesData, dataRange, scale, axes, plot],
130
+ });
131
+ }
132
+ initialize() {
133
+ super.initialize();
134
+ this.componentManager.add(Background);
135
+ this.componentManager.add(Title);
136
+ this.componentManager.add(Plot);
137
+ this.componentManager.add(Legend);
138
+ this.componentManager.add(BoxStackSeries, { name: 'column' });
139
+ this.componentManager.add(BoxSeries, { name: 'column' });
140
+ this.componentManager.add(LineSeries);
141
+ this.componentManager.add(ZeroAxis);
142
+ this.componentManager.add(Axis, { name: 'xAxis' });
143
+ this.componentManager.add(Axis, { name: 'yAxis' });
144
+ this.componentManager.add(Axis, { name: 'secondaryYAxis' });
145
+ this.componentManager.add(AxisTitle, { name: 'xAxis' });
146
+ this.componentManager.add(AxisTitle, { name: 'yAxis' });
147
+ this.componentManager.add(AxisTitle, { name: 'secondaryYAxis' });
148
+ this.componentManager.add(ExportMenu, { chartEl: this.el });
149
+ this.componentManager.add(HoveredSeries);
150
+ this.componentManager.add(SelectedSeries);
151
+ this.componentManager.add(DataLabels);
152
+ this.componentManager.add(RangeSelection);
153
+ this.componentManager.add(Tooltip, { chartEl: this.el });
154
+ this.componentManager.add(NoDataText);
155
+ this.painter.addGroups([
156
+ basicBrush,
157
+ axisBrush,
158
+ legendBrush,
159
+ labelBrush,
160
+ exportMenuBrush,
161
+ dataLabelBrush,
162
+ lineSeriesBrush,
163
+ ]);
164
+ }
165
+ handleEventForAllResponders(event, responderModels, delegationMethod, mousePosition) {
166
+ if (hasColumnLineUsingPointEventType(responderModels)) {
167
+ const columnSeries = responderModels.find(({ component }) => component.name === 'column');
168
+ columnSeries.component[delegationMethod]({ mousePosition, responders: [] }, event);
169
+ }
170
+ }
171
+ /**
172
+ * Add data.
173
+ * @param {Array} data - Array of data to be added.
174
+ * @param {string} category - Category to be added.
175
+ * @param {string} chartType - Which type of chart to add.
176
+ * @api
177
+ * @example
178
+ * chart.addData([10, 20], '6', 'line');
179
+ */
180
+ addData(data, category, chartType) {
181
+ this.animationControlFlag.updating = true;
182
+ this.resetSeries();
183
+ this.store.dispatch('addData', { data, category, chartType });
184
+ }
185
+ /**
186
+ * Add series.
187
+ * @param {Object} data - Data to be added.
188
+ * @param {string} data.name - Series name.
189
+ * @param {Array<number>} data.data - Array of data to be added.
190
+ * @param {Object} dataInfo - Which type of chart to add.
191
+ * @param {Object} dataInfo.chartType - Chart type.
192
+ * @api
193
+ * @example
194
+ * chart.addSeries(
195
+ * {
196
+ * name: 'newSeries',
197
+ * data: [10, 100, 50, 40, 70, 55, 33, 70, 90, 110],
198
+ * },
199
+ * {
200
+ * chartType: 'line'
201
+ * });
202
+ */
203
+ addSeries(data, dataInfo) {
204
+ this.resetSeries();
205
+ this.store.dispatch('addSeries', Object.assign({ data }, dataInfo));
206
+ }
207
+ /**
208
+ * Convert the chart data to new data.
209
+ * @param {Object} data - Data to be set
210
+ * @api
211
+ * @example
212
+ * chart.setData({
213
+ * categories: ['1', '2', '3'],
214
+ * series: {
215
+ * column: [
216
+ * {
217
+ * name: 'A',
218
+ * data: [1, 2, 3],
219
+ * }
220
+ * ],
221
+ * line: [
222
+ * {
223
+ * name: 'B',
224
+ * data: [4, 5, 6],
225
+ * }
226
+ * ]
227
+ * }
228
+ * });
229
+ */
230
+ setData(data) {
231
+ this.resetSeries();
232
+ this.store.dispatch('setData', data);
233
+ }
234
+ /**
235
+ * Add plot line.
236
+ * @param {Object} data - Plot info.
237
+ * @param {string|number} data.value - The value where the plot line will be drawn.
238
+ * @param {string} data.color - Plot line color.
239
+ * @param {string} [data.id] - Plot id. The value on which the removePlotLine is based.
240
+ * @api
241
+ * @example
242
+ * chart.addPlotLine({
243
+ * value: 2,
244
+ * color: '#00ff22',
245
+ * id: 'plot-1',
246
+ * });
247
+ */
248
+ addPlotLine(data) {
249
+ this.store.dispatch('addPlotLine', { data });
250
+ }
251
+ /**
252
+ * Remove plot line with id.
253
+ * @param {string} id - Id of the plot line to be removed
254
+ * @api
255
+ * @example
256
+ * chart.removePlotLine('plot-1');
257
+ */
258
+ removePlotLine(id) {
259
+ this.store.dispatch('removePlotLine', { id });
260
+ }
261
+ /**
262
+ * Add plot band.
263
+ * @param {Object} data - plot info
264
+ * @param {Array<string|number>} data.range - The range to be drawn
265
+ * @param {string} data.color - Plot band color
266
+ * @param {string} [data.id] - Plot id. The value on which the removePlotBand is based
267
+ * @api
268
+ * @example
269
+ * chart.addPlotBand({
270
+ * value: [2, 4],
271
+ * color: '#00ff22',
272
+ * id: 'plot-1',
273
+ * });
274
+ */
275
+ addPlotBand(data) {
276
+ this.store.dispatch('addPlotBand', { data });
277
+ }
278
+ /**
279
+ * Remove plot band with id.
280
+ * @param {string} id - id of the plot band to be removed
281
+ * @api
282
+ * @example
283
+ * chart.removePlotBand('plot-1');
284
+ */
285
+ removePlotBand(id) {
286
+ this.store.dispatch('removePlotBand', { id });
287
+ }
288
+ /**
289
+ * Hide series data label.
290
+ * @api
291
+ * @example
292
+ * chart.hideSeriesDataLabel();
293
+ */
294
+ hideSeriesDataLabel() {
295
+ this.store.dispatch('updateOptions', {
296
+ options: { series: { dataLabels: { visible: false } } },
297
+ });
298
+ }
299
+ /**
300
+ * Show series data label.
301
+ * @api
302
+ * @example
303
+ * chart.showSeriesDataLabel();
304
+ */
305
+ showSeriesDataLabel() {
306
+ this.store.dispatch('updateOptions', {
307
+ options: { series: { dataLabels: { visible: true } } },
308
+ });
309
+ }
310
+ /**
311
+ * Convert the chart options to new options.
312
+ * @param {Object} options - Chart options
313
+ * @api
314
+ * @example
315
+ * chart.setOptions({
316
+ * chart: {
317
+ * width: 500,
318
+ * height: 'auto',
319
+ * title: 'Energy Usage',
320
+ * },
321
+ * xAxis: {
322
+ * title: 'Month',
323
+ * date: { format: 'yy/MM' },
324
+ * },
325
+ * yAxis: {
326
+ * title: 'Energy (kWh)',
327
+ * },
328
+ * series: {
329
+ * line: {
330
+ * showDot: true,
331
+ * },
332
+ * selectable: true,
333
+ * },
334
+ * tooltip: {
335
+ * formatter: (value) => `${value}kWh`,
336
+ * },
337
+ * });
338
+ */
339
+ setOptions(options) {
340
+ this.resetSeries();
341
+ this.dispatchOptionsEvent('initOptions', options);
342
+ }
343
+ /**
344
+ * Update chart options.
345
+ * @param {Object} options - Chart options
346
+ * @api
347
+ * @example
348
+ * chart.updateOptions({
349
+ * chart: {
350
+ * height: 'auto',
351
+ * title: 'Energy Usage',
352
+ * },
353
+ * series: {
354
+ * line: {
355
+ * showDot: true,
356
+ * },
357
+ * },
358
+ * });
359
+ */
360
+ updateOptions(options) {
361
+ this.resetSeries();
362
+ this.dispatchOptionsEvent('updateOptions', options);
363
+ }
364
+ /**
365
+ * Show tooltip.
366
+ * @param {Object} seriesInfo - Information of the series for the tooltip to be displayed.
367
+ * @param {number} seriesInfo.seriesIndex - Index of series.
368
+ * @param {number} seriesInfo.index - Index of data within series.
369
+ * @param {string} seriesInfo.chartType - Specify which chart to select.
370
+ * @api
371
+ * @example
372
+ * chart.showTooltip({index: 1, seriesIndex: 2, chartType: 'column'});
373
+ */
374
+ showTooltip(seriesInfo) {
375
+ this.eventBus.emit('showTooltip', Object.assign({}, seriesInfo));
376
+ }
377
+ /**
378
+ * Hide tooltip.
379
+ * @api
380
+ * @example
381
+ * chart.hideTooltip();
382
+ */
383
+ hideTooltip() {
384
+ this.eventBus.emit('hideTooltip');
385
+ }
386
+ }
@@ -0,0 +1,191 @@
1
+ import Chart from "./chart";
2
+ import { GaugeChartOptions, GaugeSeriesData, GaugeSeriesDataType, GaugeSeriesInput, GaugePlotBand } from "../../types/options";
3
+ import { GaugeChartProps, SelectSeriesInfo } from "../../types/charts";
4
+ /**
5
+ * @class
6
+ * @classdesc Gauge Chart
7
+ * @param {Object} props
8
+ * @param {HTMLElement} props.el - The target element to create chart.
9
+ * @param {Object} props.data - Data for making Gauge Chart.
10
+ * @param {Array<string>} [props.data.categories] - Categories.
11
+ * @param {Array<Object>} props.data.series - Series data.
12
+ * @param {string} props.data.series.name - Series name.
13
+ * @param {number} props.data.series.data - Series data.
14
+ * @param {Object} [props.options] - Options for making Gauge Chart.
15
+ * @param {Object} [props.options.chart]
16
+ * @param {string|Object} [props.options.chart.title] - Chart title text or options.
17
+ * @param {string} [props.options.chart.title.text] - Chart title text.
18
+ * @param {number} [props.options.chart.title.offsetX] - Offset value to move title horizontally.
19
+ * @param {number} [props.options.chart.title.offsetY] - Offset value to move title vertically.
20
+ * @param {string} [props.options.chart.title.align] - Chart text align. 'left', 'right', 'center' is available.
21
+ * @param {boolean|Object} [props.options.chart.animation] - Whether to use animation and duration when rendering the initial chart.
22
+ * @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.
23
+ * @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.
24
+ * @param {Object} [props.options.series]
25
+ * @param {boolean} [props.options.series.selectable=false] - Whether to make selectable series or not.
26
+ * @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|Gauge Chart guide} on github.
27
+ * @param {Array<number>} [props.options.series.angleRange] - The range of angles to which the circle will be drawn. It is specified by putting number in start and end.
28
+ * @param {boolean} [props.options.series.clockwise] - Whether it will be drawn clockwise.
29
+ * @param {boolean | Object} [props.options.series.solid] - When this option is set, the radial bar is displayed. It can be used when there is one series data. The default value is 'false'.
30
+ * @param {Object} [props.options.circularAxis]
31
+ * @param {string|Object} [props.options.circularAxis.title] - Axis title.
32
+ * @param {Object} [props.options.circularAxis.tick] - Option to adjust tick interval.
33
+ * @param {Object} [props.options.circularAxis.label] - Option to adjust label interval.
34
+ * @param {Object} [props.options.circularAxis.scale] - Option to adjust axis minimum, maximum, step size.
35
+ * @param {Object} [props.options.plot]
36
+ * @param {number} [props.options.plot.width] - Width of plot.
37
+ * @param {number} [props.options.plot.height] - Height of plot.
38
+ * @param {Array<Object>} [props.options.plot.bands] - Plot bands information. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Gauge Chart guide} on github.
39
+ * @param {Object} [props.options.exportMenu]
40
+ * @param {boolean} [props.options.exportMenu.visible] - Whether to show export menu.
41
+ * @param {string} [props.options.exportMenu.filename] - File name applied when downloading.
42
+ * @param {Object} [props.options.tooltip]
43
+ * @param {number} [props.options.tooltip.offsetX] - Offset value to move title horizontally.
44
+ * @param {number} [props.options.tooltip.offsetY] - Offset value to move title vertically.
45
+ * @param {Function} [props.options.tooltip.formatter] - Function to format data value.
46
+ * @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.
47
+ * @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.
48
+ * @param {boolean|Object} [props.options.responsive.animation] - Animation duration when the chart is modified.
49
+ * @param {Array<Object>} [props.options.responsive.rules] - Rules for the Chart to Respond.
50
+ * @param {Object} [props.options.theme] - Chart theme options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Gauge Chart guide} on github.
51
+ * @param {Object} [props.options.theme.chart] - Chart font theme.
52
+ * @param {Object} [props.options.theme.series] - Series theme.
53
+ * @param {Object} [props.options.theme.title] - Title theme.
54
+ * @param {Object} [props.options.theme.circularAxis] - Circular Axis theme.
55
+ * @param {Object} [props.options.theme.tooltip] - Tooltip theme.
56
+ * @param {Object} [props.options.theme.exportMenu] - ExportMenu theme.
57
+ * @param {Object} [props.options.theme.plot] - Plot Theme.
58
+ * @extends Chart
59
+ */
60
+ export default class GaugeChart extends Chart<GaugeChartOptions> {
61
+ constructor({ el, options, data }: GaugeChartProps);
62
+ protected initialize(): void;
63
+ /**
64
+ * Add series.
65
+ * @param {Object} data - Data to be added.
66
+ * @param {string} data.name - Series name.
67
+ * @param {Array<number|Array<number>>} data.data - Array of data to be added.
68
+ * @api
69
+ * @example
70
+ * chart.addSeries({
71
+ * name: 'newSeries',
72
+ * data: [10, 20],
73
+ * });
74
+ */
75
+ addSeries(data: GaugeSeriesInput): void;
76
+ /**
77
+ * Add data.
78
+ * @param {Array} data - Array of data to be added.
79
+ * @param {string} [category] - Category to be added.
80
+ * @api
81
+ * @example
82
+ * // without categories
83
+ * chart.addData([10], '6');
84
+ *
85
+ * // with categories
86
+ * chart.addData([10], '6');
87
+ */
88
+ addData(data: GaugeSeriesDataType[], category?: string): void;
89
+ /**
90
+ * Convert the chart data to new data.
91
+ * @param {Object} data - Data to be set.
92
+ * @api
93
+ * @example
94
+ * chart.setData({
95
+ * categories: ['1', '2', '3'],
96
+ * series: [
97
+ * {
98
+ * name: 'new series',
99
+ * data: [1, 2, 3],
100
+ * },
101
+ * {
102
+ * name: 'new series2',
103
+ * data: [4, 5, 6],
104
+ * }
105
+ * ]
106
+ * });
107
+ */
108
+ setData(data: GaugeSeriesData): void;
109
+ /**
110
+ * Hide series data label.
111
+ * @api
112
+ * @example
113
+ * chart.hideSeriesDataLabel();
114
+ */
115
+ hideSeriesDataLabel(): void;
116
+ /**
117
+ * Show series data label.
118
+ * @api
119
+ * @example
120
+ * chart.showSeriesDataLabel();
121
+ */
122
+ showSeriesDataLabel(): void;
123
+ /**
124
+ * Convert the chart options to new options.
125
+ * @param {Object} options - Chart options.
126
+ * @api
127
+ * @example
128
+ * chart.setOptions({
129
+ * chart: {
130
+ * width: 500,
131
+ * height: 500,
132
+ * title: 'Olympic Medals',
133
+ * },
134
+ * series: {
135
+ * selectable: true
136
+ * }
137
+ * });
138
+ */
139
+ setOptions(options: GaugeChartOptions): void;
140
+ /**
141
+ * Update chart options.
142
+ * @param {Object} options - Chart options.
143
+ * @api
144
+ * @example
145
+ * chart.updateOptions({
146
+ * chart: {
147
+ * title: 'Olympic Medals',
148
+ * }
149
+ * });
150
+ */
151
+ updateOptions(options: GaugeChartOptions): void;
152
+ /**
153
+ * Show tooltip.
154
+ * @param {Object} seriesInfo - Information of the series for the tooltip to be displayed.
155
+ * @param {number} seriesInfo.index - Index of data within series.
156
+ * @api
157
+ * @example
158
+ * chart.showTooltip({index: 1});
159
+ */
160
+ showTooltip(seriesInfo: SelectSeriesInfo): void;
161
+ /**
162
+ * Hide tooltip.
163
+ * @api
164
+ * @example
165
+ * chart.hideTooltip();
166
+ */
167
+ hideTooltip(): void;
168
+ /**
169
+ * Add plot band.
170
+ * @param {Object} data - Plot info.
171
+ * @param {Array<string|number>} data.range - The range to be drawn.
172
+ * @param {string} data.color - Plot band color.
173
+ * @param {string} [data.id] - Plot id. The value on which the removePlotBand is based.
174
+ * @api
175
+ * @example
176
+ * chart.addPlotBand({
177
+ * range: [10, 20],
178
+ * color: '#00ff22',
179
+ * id: 'plot-1',
180
+ * });
181
+ */
182
+ addPlotBand(data: GaugePlotBand): void;
183
+ /**
184
+ * Remove plot band with id.
185
+ * @param {string} id - id of the plot band to be removed
186
+ * @api
187
+ * @example
188
+ * chart.removePlotBand('plot-1');
189
+ */
190
+ removePlotBand(id: string): void;
191
+ }