@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.
- package/README.md +165 -0
- package/dist/esm/animator.d.ts +32 -0
- package/dist/esm/animator.js +102 -0
- package/dist/esm/brushes/axis.d.ts +3 -0
- package/dist/esm/brushes/axis.js +21 -0
- package/dist/esm/brushes/basic.d.ts +9 -0
- package/dist/esm/brushes/basic.js +95 -0
- package/dist/esm/brushes/boxPlot.d.ts +2 -0
- package/dist/esm/brushes/boxPlot.js +22 -0
- package/dist/esm/brushes/circleLegend.d.ts +2 -0
- package/dist/esm/brushes/circleLegend.js +26 -0
- package/dist/esm/brushes/dataLabel.d.ts +6 -0
- package/dist/esm/brushes/dataLabel.js +176 -0
- package/dist/esm/brushes/exportMenu.d.ts +2 -0
- package/dist/esm/brushes/exportMenu.js +55 -0
- package/dist/esm/brushes/gauge.d.ts +2 -0
- package/dist/esm/brushes/gauge.js +39 -0
- package/dist/esm/brushes/label.d.ts +34 -0
- package/dist/esm/brushes/label.js +165 -0
- package/dist/esm/brushes/legend.d.ts +7 -0
- package/dist/esm/brushes/legend.js +162 -0
- package/dist/esm/brushes/lineSeries.d.ts +5 -0
- package/dist/esm/brushes/lineSeries.js +41 -0
- package/dist/esm/brushes/polygon.d.ts +2 -0
- package/dist/esm/brushes/polygon.js +24 -0
- package/dist/esm/brushes/resetButton.d.ts +3 -0
- package/dist/esm/brushes/resetButton.js +112 -0
- package/dist/esm/brushes/scatterSeries.d.ts +2 -0
- package/dist/esm/brushes/scatterSeries.js +125 -0
- package/dist/esm/brushes/sector.d.ts +2 -0
- package/dist/esm/brushes/sector.js +54 -0
- package/dist/esm/brushes/spectrumLegend.d.ts +14 -0
- package/dist/esm/brushes/spectrumLegend.js +199 -0
- package/dist/esm/charts/areaChart.d.ts +254 -0
- package/dist/esm/charts/areaChart.js +358 -0
- package/dist/esm/charts/barChart.d.ts +203 -0
- package/dist/esm/charts/barChart.js +300 -0
- package/dist/esm/charts/boxPlotChart.d.ts +209 -0
- package/dist/esm/charts/boxPlotChart.js +288 -0
- package/dist/esm/charts/bubbleChart.d.ts +188 -0
- package/dist/esm/charts/bubbleChart.js +263 -0
- package/dist/esm/charts/bulletChart.d.ts +199 -0
- package/dist/esm/charts/bulletChart.js +278 -0
- package/dist/esm/charts/chart.d.ts +133 -0
- package/dist/esm/charts/chart.js +484 -0
- package/dist/esm/charts/columnChart.d.ts +205 -0
- package/dist/esm/charts/columnChart.js +299 -0
- package/dist/esm/charts/columnLineChart.d.ts +271 -0
- package/dist/esm/charts/columnLineChart.js +386 -0
- package/dist/esm/charts/gaugeChart.d.ts +191 -0
- package/dist/esm/charts/gaugeChart.js +279 -0
- package/dist/esm/charts/heatmapChart.d.ts +199 -0
- package/dist/esm/charts/heatmapChart.js +292 -0
- package/dist/esm/charts/lineAreaChart.d.ts +271 -0
- package/dist/esm/charts/lineAreaChart.js +374 -0
- package/dist/esm/charts/lineChart.d.ts +253 -0
- package/dist/esm/charts/lineChart.js +360 -0
- package/dist/esm/charts/lineScatterChart.d.ts +200 -0
- package/dist/esm/charts/lineScatterChart.js +285 -0
- package/dist/esm/charts/nestedPieChart.d.ts +192 -0
- package/dist/esm/charts/nestedPieChart.js +268 -0
- package/dist/esm/charts/pieChart.d.ts +156 -0
- package/dist/esm/charts/pieChart.js +224 -0
- package/dist/esm/charts/radarChart.d.ts +169 -0
- package/dist/esm/charts/radarChart.js +240 -0
- package/dist/esm/charts/radialBarChart.d.ts +172 -0
- package/dist/esm/charts/radialBarChart.js +251 -0
- package/dist/esm/charts/scatterChart.d.ts +184 -0
- package/dist/esm/charts/scatterChart.js +279 -0
- package/dist/esm/charts/treemapChart.d.ts +166 -0
- package/dist/esm/charts/treemapChart.js +239 -0
- package/dist/esm/component/areaSeries.d.ts +96 -0
- package/dist/esm/component/areaSeries.js +474 -0
- package/dist/esm/component/axis.d.ts +40 -0
- package/dist/esm/component/axis.js +176 -0
- package/dist/esm/component/axisTitle.d.ts +25 -0
- package/dist/esm/component/axisTitle.js +67 -0
- package/dist/esm/component/axisUsingCenterY.d.ts +32 -0
- package/dist/esm/component/axisUsingCenterY.js +175 -0
- package/dist/esm/component/backButton.d.ts +13 -0
- package/dist/esm/component/backButton.js +26 -0
- package/dist/esm/component/background.d.ts +10 -0
- package/dist/esm/component/background.js +15 -0
- package/dist/esm/component/boxPlotSeries.d.ts +126 -0
- package/dist/esm/component/boxPlotSeries.js +410 -0
- package/dist/esm/component/boxSeries.d.ts +211 -0
- package/dist/esm/component/boxSeries.js +603 -0
- package/dist/esm/component/boxStackSeries.d.ts +62 -0
- package/dist/esm/component/boxStackSeries.js +447 -0
- package/dist/esm/component/bubbleSeries.d.ts +35 -0
- package/dist/esm/component/bubbleSeries.js +174 -0
- package/dist/esm/component/bulletSeries.d.ts +89 -0
- package/dist/esm/component/bulletSeries.js +392 -0
- package/dist/esm/component/circleLegend.d.ts +10 -0
- package/dist/esm/component/circleLegend.js +37 -0
- package/dist/esm/component/component.d.ts +64 -0
- package/dist/esm/component/component.js +170 -0
- package/dist/esm/component/componentManager.d.ts +23 -0
- package/dist/esm/component/componentManager.js +45 -0
- package/dist/esm/component/dataLabels.d.ts +23 -0
- package/dist/esm/component/dataLabels.js +134 -0
- package/dist/esm/component/exportMenu.d.ts +38 -0
- package/dist/esm/component/exportMenu.js +147 -0
- package/dist/esm/component/gaugeSeries.d.ts +160 -0
- package/dist/esm/component/gaugeSeries.js +447 -0
- package/dist/esm/component/heatmapSeries.d.ts +64 -0
- package/dist/esm/component/heatmapSeries.js +152 -0
- package/dist/esm/component/hoveredSeries.d.ts +27 -0
- package/dist/esm/component/hoveredSeries.js +95 -0
- package/dist/esm/component/legend.d.ts +26 -0
- package/dist/esm/component/legend.js +149 -0
- package/dist/esm/component/lineSeries.d.ts +69 -0
- package/dist/esm/component/lineSeries.js +319 -0
- package/dist/esm/component/noDataText.d.ts +9 -0
- package/dist/esm/component/noDataText.js +31 -0
- package/dist/esm/component/pieSeries.d.ts +137 -0
- package/dist/esm/component/pieSeries.js +390 -0
- package/dist/esm/component/plot.d.ts +37 -0
- package/dist/esm/component/plot.js +163 -0
- package/dist/esm/component/radarSeries.d.ts +85 -0
- package/dist/esm/component/radarSeries.js +222 -0
- package/dist/esm/component/radialAxis.d.ts +26 -0
- package/dist/esm/component/radialAxis.js +210 -0
- package/dist/esm/component/radialBarSeries.d.ts +111 -0
- package/dist/esm/component/radialBarSeries.js +349 -0
- package/dist/esm/component/radialPlot.d.ts +55 -0
- package/dist/esm/component/radialPlot.js +188 -0
- package/dist/esm/component/rangeSelection.d.ts +61 -0
- package/dist/esm/component/rangeSelection.js +150 -0
- package/dist/esm/component/resetButton.d.ts +13 -0
- package/dist/esm/component/resetButton.js +26 -0
- package/dist/esm/component/scatterSeries.d.ts +34 -0
- package/dist/esm/component/scatterSeries.js +159 -0
- package/dist/esm/component/selectedSeries.d.ts +26 -0
- package/dist/esm/component/selectedSeries.js +109 -0
- package/dist/esm/component/spectrumLegend.d.ts +15 -0
- package/dist/esm/component/spectrumLegend.js +76 -0
- package/dist/esm/component/title.d.ts +12 -0
- package/dist/esm/component/title.js +53 -0
- package/dist/esm/component/tooltip.d.ts +41 -0
- package/dist/esm/component/tooltip.js +131 -0
- package/dist/esm/component/treemapSeries.d.ts +57 -0
- package/dist/esm/component/treemapSeries.js +191 -0
- package/dist/esm/component/zeroAxis.d.ts +9 -0
- package/dist/esm/component/zeroAxis.js +49 -0
- package/dist/esm/eventEmitter.d.ts +8 -0
- package/dist/esm/eventEmitter.js +15 -0
- package/dist/esm/helpers/arrayUtil.d.ts +10 -0
- package/dist/esm/helpers/arrayUtil.js +54 -0
- package/dist/esm/helpers/axes.d.ts +67 -0
- package/dist/esm/helpers/axes.js +345 -0
- package/dist/esm/helpers/boxSeries.d.ts +5 -0
- package/dist/esm/helpers/boxSeries.js +71 -0
- package/dist/esm/helpers/calculator.d.ts +19 -0
- package/dist/esm/helpers/calculator.js +153 -0
- package/dist/esm/helpers/color.d.ts +153 -0
- package/dist/esm/helpers/color.js +218 -0
- package/dist/esm/helpers/colorSpectrum.d.ts +5 -0
- package/dist/esm/helpers/colorSpectrum.js +17 -0
- package/dist/esm/helpers/coordinate.d.ts +9 -0
- package/dist/esm/helpers/coordinate.js +51 -0
- package/dist/esm/helpers/dataLabels.d.ts +36 -0
- package/dist/esm/helpers/dataLabels.js +405 -0
- package/dist/esm/helpers/dom.d.ts +2 -0
- package/dist/esm/helpers/dom.js +8 -0
- package/dist/esm/helpers/downloader.d.ts +7 -0
- package/dist/esm/helpers/downloader.js +287 -0
- package/dist/esm/helpers/formatDate.d.ts +16 -0
- package/dist/esm/helpers/formatDate.js +140 -0
- package/dist/esm/helpers/geometric.d.ts +3 -0
- package/dist/esm/helpers/geometric.js +35 -0
- package/dist/esm/helpers/googleAnalytics.d.ts +1 -0
- package/dist/esm/helpers/googleAnalytics.js +39 -0
- package/dist/esm/helpers/htmlSanitizer.d.ts +1 -0
- package/dist/esm/helpers/htmlSanitizer.js +86 -0
- package/dist/esm/helpers/legend.d.ts +9 -0
- package/dist/esm/helpers/legend.js +47 -0
- package/dist/esm/helpers/pieSeries.d.ts +15 -0
- package/dist/esm/helpers/pieSeries.js +72 -0
- package/dist/esm/helpers/plot.d.ts +2 -0
- package/dist/esm/helpers/plot.js +4 -0
- package/dist/esm/helpers/radarSeries.d.ts +1 -0
- package/dist/esm/helpers/radarSeries.js +7 -0
- package/dist/esm/helpers/range.d.ts +6 -0
- package/dist/esm/helpers/range.js +16 -0
- package/dist/esm/helpers/responders.d.ts +37 -0
- package/dist/esm/helpers/responders.js +197 -0
- package/dist/esm/helpers/sector.d.ts +55 -0
- package/dist/esm/helpers/sector.js +117 -0
- package/dist/esm/helpers/squarifier.d.ts +8 -0
- package/dist/esm/helpers/squarifier.js +110 -0
- package/dist/esm/helpers/style.d.ts +14 -0
- package/dist/esm/helpers/style.js +48 -0
- package/dist/esm/helpers/theme.d.ts +58 -0
- package/dist/esm/helpers/theme.js +557 -0
- package/dist/esm/helpers/tooltip.d.ts +2 -0
- package/dist/esm/helpers/tooltip.js +18 -0
- package/dist/esm/helpers/tooltipTemplate.d.ts +21 -0
- package/dist/esm/helpers/tooltipTemplate.js +147 -0
- package/dist/esm/helpers/utils.d.ts +42 -0
- package/dist/esm/helpers/utils.js +268 -0
- package/dist/esm/helpers/validation.d.ts +6 -0
- package/dist/esm/helpers/validation.js +16 -0
- package/dist/esm/index.d.ts +40 -0
- package/dist/esm/index.js +75 -0
- package/dist/esm/message.d.ts +11 -0
- package/dist/esm/message.js +11 -0
- package/dist/esm/painter.d.ts +27 -0
- package/dist/esm/painter.js +88 -0
- package/dist/esm/responderDetectors.d.ts +6 -0
- package/dist/esm/responderDetectors.js +124 -0
- package/dist/esm/scale/coordinateScaleCalculator.d.ts +24 -0
- package/dist/esm/scale/coordinateScaleCalculator.js +174 -0
- package/dist/esm/scale/datetimeScaleCalculator.d.ts +20 -0
- package/dist/esm/scale/datetimeScaleCalculator.js +59 -0
- package/dist/esm/store/axes.d.ts +30 -0
- package/dist/esm/store/axes.js +282 -0
- package/dist/esm/store/category.d.ts +4 -0
- package/dist/esm/store/category.js +73 -0
- package/dist/esm/store/colorValueScale.d.ts +3 -0
- package/dist/esm/store/colorValueScale.js +56 -0
- package/dist/esm/store/dataRange.d.ts +4 -0
- package/dist/esm/store/dataRange.js +170 -0
- package/dist/esm/store/gaugeAxes.d.ts +4 -0
- package/dist/esm/store/gaugeAxes.js +175 -0
- package/dist/esm/store/heatmapAxes.d.ts +3 -0
- package/dist/esm/store/heatmapAxes.js +98 -0
- package/dist/esm/store/heatmapSeriesData.d.ts +3 -0
- package/dist/esm/store/heatmapSeriesData.js +34 -0
- package/dist/esm/store/layout.d.ts +12 -0
- package/dist/esm/store/layout.js +487 -0
- package/dist/esm/store/legend.d.ts +3 -0
- package/dist/esm/store/legend.js +435 -0
- package/dist/esm/store/nestedPieSeriesData.d.ts +3 -0
- package/dist/esm/store/nestedPieSeriesData.js +49 -0
- package/dist/esm/store/options.d.ts +3 -0
- package/dist/esm/store/options.js +62 -0
- package/dist/esm/store/plot.d.ts +3 -0
- package/dist/esm/store/plot.js +102 -0
- package/dist/esm/store/radialAxes.d.ts +8 -0
- package/dist/esm/store/radialAxes.js +199 -0
- package/dist/esm/store/reactive.d.ts +11 -0
- package/dist/esm/store/reactive.js +196 -0
- package/dist/esm/store/root.d.ts +3 -0
- package/dist/esm/store/root.js +46 -0
- package/dist/esm/store/scale.d.ts +3 -0
- package/dist/esm/store/scale.js +102 -0
- package/dist/esm/store/seriesData.d.ts +3 -0
- package/dist/esm/store/seriesData.js +299 -0
- package/dist/esm/store/stackSeriesData.d.ts +8 -0
- package/dist/esm/store/stackSeriesData.js +192 -0
- package/dist/esm/store/store.d.ts +20 -0
- package/dist/esm/store/store.js +112 -0
- package/dist/esm/store/theme.d.ts +3 -0
- package/dist/esm/store/theme.js +139 -0
- package/dist/esm/store/treemapSeriesData.d.ts +4 -0
- package/dist/esm/store/treemapSeriesData.js +93 -0
- package/dist/td-chart.css +127 -0
- package/dist/td-chart.js +41463 -0
- package/dist/td-chart.min.css +6 -0
- package/dist/td-chart.min.js +9 -0
- package/package.json +112 -0
- package/types/brushes.d.ts +30 -0
- package/types/charts.d.ts +152 -0
- package/types/components/axis.d.ts +71 -0
- package/types/components/circleLegend.d.ts +9 -0
- package/types/components/dataLabels.d.ts +119 -0
- package/types/components/exportMenu.d.ts +14 -0
- package/types/components/legend.d.ts +27 -0
- package/types/components/plot.d.ts +8 -0
- package/types/components/radialAxis.d.ts +22 -0
- package/types/components/radialPlot.d.ts +11 -0
- package/types/components/rangeSelection.d.ts +3 -0
- package/types/components/resetButton.d.ts +13 -0
- package/types/components/series.d.ts +386 -0
- package/types/components/spectrumLegend.d.ts +25 -0
- package/types/components/tooltip.d.ts +58 -0
- package/types/components/zoom.d.ts +3 -0
- package/types/eventEmitter.d.ts +12 -0
- package/types/index.d.ts +615 -0
- package/types/options.d.ts +833 -0
- package/types/resizeObserver.d.ts +54 -0
- package/types/store/store.d.ts +564 -0
- 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 gaugeAxesData from "../store/gaugeAxes";
|
|
5
|
+
import Tooltip from "../component/tooltip";
|
|
6
|
+
import GaugeSeries from "../component/gaugeSeries";
|
|
7
|
+
import Title from "../component/title";
|
|
8
|
+
import ExportMenu from "../component/exportMenu";
|
|
9
|
+
import HoveredSeries from "../component/hoveredSeries";
|
|
10
|
+
import DataLabels from "../component/dataLabels";
|
|
11
|
+
import AxisTitle from "../component/axisTitle";
|
|
12
|
+
import SelectedSeries from "../component/selectedSeries";
|
|
13
|
+
import Background from "../component/background";
|
|
14
|
+
import RadialAxis from "../component/radialAxis";
|
|
15
|
+
import RadialPlot from "../component/radialPlot";
|
|
16
|
+
import NoDataText from "../component/noDataText";
|
|
17
|
+
import * as basicBrush from "../brushes/basic";
|
|
18
|
+
import * as legendBrush from "../brushes/legend";
|
|
19
|
+
import * as labelBrush from "../brushes/label";
|
|
20
|
+
import * as exportMenuBrush from "../brushes/exportMenu";
|
|
21
|
+
import * as sectorBrush from "../brushes/sector";
|
|
22
|
+
import * as dataLabelBrush from "../brushes/dataLabel";
|
|
23
|
+
import * as axisBrush from "../brushes/axis";
|
|
24
|
+
import * as gaugeBrush from "../brushes/gauge";
|
|
25
|
+
/**
|
|
26
|
+
* @class
|
|
27
|
+
* @classdesc Gauge Chart
|
|
28
|
+
* @param {Object} props
|
|
29
|
+
* @param {HTMLElement} props.el - The target element to create chart.
|
|
30
|
+
* @param {Object} props.data - Data for making Gauge Chart.
|
|
31
|
+
* @param {Array<string>} [props.data.categories] - Categories.
|
|
32
|
+
* @param {Array<Object>} props.data.series - Series data.
|
|
33
|
+
* @param {string} props.data.series.name - Series name.
|
|
34
|
+
* @param {number} props.data.series.data - Series data.
|
|
35
|
+
* @param {Object} [props.options] - Options for making Gauge Chart.
|
|
36
|
+
* @param {Object} [props.options.chart]
|
|
37
|
+
* @param {string|Object} [props.options.chart.title] - Chart title text or options.
|
|
38
|
+
* @param {string} [props.options.chart.title.text] - Chart title text.
|
|
39
|
+
* @param {number} [props.options.chart.title.offsetX] - Offset value to move title horizontally.
|
|
40
|
+
* @param {number} [props.options.chart.title.offsetY] - Offset value to move title vertically.
|
|
41
|
+
* @param {string} [props.options.chart.title.align] - Chart text align. 'left', 'right', 'center' is available.
|
|
42
|
+
* @param {boolean|Object} [props.options.chart.animation] - Whether to use animation and duration when rendering the initial chart.
|
|
43
|
+
* @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.
|
|
44
|
+
* @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.
|
|
45
|
+
* @param {Object} [props.options.series]
|
|
46
|
+
* @param {boolean} [props.options.series.selectable=false] - Whether to make selectable series or not.
|
|
47
|
+
* @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.
|
|
48
|
+
* @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.
|
|
49
|
+
* @param {boolean} [props.options.series.clockwise] - Whether it will be drawn clockwise.
|
|
50
|
+
* @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'.
|
|
51
|
+
* @param {Object} [props.options.circularAxis]
|
|
52
|
+
* @param {string|Object} [props.options.circularAxis.title] - Axis title.
|
|
53
|
+
* @param {Object} [props.options.circularAxis.tick] - Option to adjust tick interval.
|
|
54
|
+
* @param {Object} [props.options.circularAxis.label] - Option to adjust label interval.
|
|
55
|
+
* @param {Object} [props.options.circularAxis.scale] - Option to adjust axis minimum, maximum, step size.
|
|
56
|
+
* @param {Object} [props.options.plot]
|
|
57
|
+
* @param {number} [props.options.plot.width] - Width of plot.
|
|
58
|
+
* @param {number} [props.options.plot.height] - Height of plot.
|
|
59
|
+
* @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.
|
|
60
|
+
* @param {Object} [props.options.exportMenu]
|
|
61
|
+
* @param {boolean} [props.options.exportMenu.visible] - Whether to show export menu.
|
|
62
|
+
* @param {string} [props.options.exportMenu.filename] - File name applied when downloading.
|
|
63
|
+
* @param {Object} [props.options.tooltip]
|
|
64
|
+
* @param {number} [props.options.tooltip.offsetX] - Offset value to move title horizontally.
|
|
65
|
+
* @param {number} [props.options.tooltip.offsetY] - Offset value to move title vertically.
|
|
66
|
+
* @param {Function} [props.options.tooltip.formatter] - Function to format data value.
|
|
67
|
+
* @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.
|
|
68
|
+
* @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.
|
|
69
|
+
* @param {boolean|Object} [props.options.responsive.animation] - Animation duration when the chart is modified.
|
|
70
|
+
* @param {Array<Object>} [props.options.responsive.rules] - Rules for the Chart to Respond.
|
|
71
|
+
* @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.
|
|
72
|
+
* @param {Object} [props.options.theme.chart] - Chart font theme.
|
|
73
|
+
* @param {Object} [props.options.theme.series] - Series theme.
|
|
74
|
+
* @param {Object} [props.options.theme.title] - Title theme.
|
|
75
|
+
* @param {Object} [props.options.theme.circularAxis] - Circular Axis theme.
|
|
76
|
+
* @param {Object} [props.options.theme.tooltip] - Tooltip theme.
|
|
77
|
+
* @param {Object} [props.options.theme.exportMenu] - ExportMenu theme.
|
|
78
|
+
* @param {Object} [props.options.theme.plot] - Plot Theme.
|
|
79
|
+
* @extends Chart
|
|
80
|
+
*/
|
|
81
|
+
export default class GaugeChart extends Chart {
|
|
82
|
+
constructor({ el, options, data }) {
|
|
83
|
+
super({
|
|
84
|
+
el,
|
|
85
|
+
options,
|
|
86
|
+
series: {
|
|
87
|
+
gauge: data.series,
|
|
88
|
+
},
|
|
89
|
+
categories: data.categories,
|
|
90
|
+
modules: [dataRange, scale, gaugeAxesData],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
initialize() {
|
|
94
|
+
super.initialize();
|
|
95
|
+
this.componentManager.add(Background);
|
|
96
|
+
this.componentManager.add(Title);
|
|
97
|
+
this.componentManager.add(RadialPlot, { name: 'gauge' });
|
|
98
|
+
this.componentManager.add(RadialAxis, { name: 'gauge' });
|
|
99
|
+
this.componentManager.add(AxisTitle, { name: 'circularAxis' });
|
|
100
|
+
this.componentManager.add(GaugeSeries);
|
|
101
|
+
this.componentManager.add(HoveredSeries);
|
|
102
|
+
this.componentManager.add(SelectedSeries);
|
|
103
|
+
this.componentManager.add(DataLabels);
|
|
104
|
+
this.componentManager.add(ExportMenu, { chartEl: this.el });
|
|
105
|
+
this.componentManager.add(Tooltip, { chartEl: this.el });
|
|
106
|
+
this.componentManager.add(NoDataText);
|
|
107
|
+
this.painter.addGroups([
|
|
108
|
+
basicBrush,
|
|
109
|
+
legendBrush,
|
|
110
|
+
labelBrush,
|
|
111
|
+
exportMenuBrush,
|
|
112
|
+
sectorBrush,
|
|
113
|
+
dataLabelBrush,
|
|
114
|
+
axisBrush,
|
|
115
|
+
gaugeBrush,
|
|
116
|
+
]);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Add series.
|
|
120
|
+
* @param {Object} data - Data to be added.
|
|
121
|
+
* @param {string} data.name - Series name.
|
|
122
|
+
* @param {Array<number|Array<number>>} data.data - Array of data to be added.
|
|
123
|
+
* @api
|
|
124
|
+
* @example
|
|
125
|
+
* chart.addSeries({
|
|
126
|
+
* name: 'newSeries',
|
|
127
|
+
* data: [10, 20],
|
|
128
|
+
* });
|
|
129
|
+
*/
|
|
130
|
+
addSeries(data) {
|
|
131
|
+
this.resetSeries();
|
|
132
|
+
this.store.dispatch('addSeries', { data });
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Add data.
|
|
136
|
+
* @param {Array} data - Array of data to be added.
|
|
137
|
+
* @param {string} [category] - Category to be added.
|
|
138
|
+
* @api
|
|
139
|
+
* @example
|
|
140
|
+
* // without categories
|
|
141
|
+
* chart.addData([10], '6');
|
|
142
|
+
*
|
|
143
|
+
* // with categories
|
|
144
|
+
* chart.addData([10], '6');
|
|
145
|
+
*/
|
|
146
|
+
addData(data, category) {
|
|
147
|
+
this.resetSeries();
|
|
148
|
+
this.animationControlFlag.updating = true;
|
|
149
|
+
this.store.dispatch('addData', { data, category });
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Convert the chart data to new data.
|
|
153
|
+
* @param {Object} data - Data to be set.
|
|
154
|
+
* @api
|
|
155
|
+
* @example
|
|
156
|
+
* chart.setData({
|
|
157
|
+
* categories: ['1', '2', '3'],
|
|
158
|
+
* series: [
|
|
159
|
+
* {
|
|
160
|
+
* name: 'new series',
|
|
161
|
+
* data: [1, 2, 3],
|
|
162
|
+
* },
|
|
163
|
+
* {
|
|
164
|
+
* name: 'new series2',
|
|
165
|
+
* data: [4, 5, 6],
|
|
166
|
+
* }
|
|
167
|
+
* ]
|
|
168
|
+
* });
|
|
169
|
+
*/
|
|
170
|
+
setData(data) {
|
|
171
|
+
const { categories, series } = data;
|
|
172
|
+
this.resetSeries();
|
|
173
|
+
this.store.dispatch('setData', { series: { gauge: series }, categories });
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Hide series data label.
|
|
177
|
+
* @api
|
|
178
|
+
* @example
|
|
179
|
+
* chart.hideSeriesDataLabel();
|
|
180
|
+
*/
|
|
181
|
+
hideSeriesDataLabel() {
|
|
182
|
+
this.store.dispatch('updateOptions', {
|
|
183
|
+
options: { series: { dataLabels: { visible: false } } },
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Show series data label.
|
|
188
|
+
* @api
|
|
189
|
+
* @example
|
|
190
|
+
* chart.showSeriesDataLabel();
|
|
191
|
+
*/
|
|
192
|
+
showSeriesDataLabel() {
|
|
193
|
+
this.store.dispatch('updateOptions', {
|
|
194
|
+
options: { series: { dataLabels: { visible: true } } },
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Convert the chart options to new options.
|
|
199
|
+
* @param {Object} options - Chart options.
|
|
200
|
+
* @api
|
|
201
|
+
* @example
|
|
202
|
+
* chart.setOptions({
|
|
203
|
+
* chart: {
|
|
204
|
+
* width: 500,
|
|
205
|
+
* height: 500,
|
|
206
|
+
* title: 'Olympic Medals',
|
|
207
|
+
* },
|
|
208
|
+
* series: {
|
|
209
|
+
* selectable: true
|
|
210
|
+
* }
|
|
211
|
+
* });
|
|
212
|
+
*/
|
|
213
|
+
setOptions(options) {
|
|
214
|
+
this.resetSeries();
|
|
215
|
+
this.dispatchOptionsEvent('initOptions', options);
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Update chart options.
|
|
219
|
+
* @param {Object} options - Chart options.
|
|
220
|
+
* @api
|
|
221
|
+
* @example
|
|
222
|
+
* chart.updateOptions({
|
|
223
|
+
* chart: {
|
|
224
|
+
* title: 'Olympic Medals',
|
|
225
|
+
* }
|
|
226
|
+
* });
|
|
227
|
+
*/
|
|
228
|
+
updateOptions(options) {
|
|
229
|
+
this.resetSeries();
|
|
230
|
+
this.dispatchOptionsEvent('updateOptions', options);
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Show tooltip.
|
|
234
|
+
* @param {Object} seriesInfo - Information of the series for the tooltip to be displayed.
|
|
235
|
+
* @param {number} seriesInfo.index - Index of data within series.
|
|
236
|
+
* @api
|
|
237
|
+
* @example
|
|
238
|
+
* chart.showTooltip({index: 1});
|
|
239
|
+
*/
|
|
240
|
+
showTooltip(seriesInfo) {
|
|
241
|
+
this.eventBus.emit('showTooltip', Object.assign(Object.assign({}, seriesInfo), { state: this.store.state }));
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Hide tooltip.
|
|
245
|
+
* @api
|
|
246
|
+
* @example
|
|
247
|
+
* chart.hideTooltip();
|
|
248
|
+
*/
|
|
249
|
+
hideTooltip() {
|
|
250
|
+
this.eventBus.emit('hideTooltip');
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Add plot band.
|
|
254
|
+
* @param {Object} data - Plot info.
|
|
255
|
+
* @param {Array<string|number>} data.range - The range to be drawn.
|
|
256
|
+
* @param {string} data.color - Plot band color.
|
|
257
|
+
* @param {string} [data.id] - Plot id. The value on which the removePlotBand is based.
|
|
258
|
+
* @api
|
|
259
|
+
* @example
|
|
260
|
+
* chart.addPlotBand({
|
|
261
|
+
* range: [10, 20],
|
|
262
|
+
* color: '#00ff22',
|
|
263
|
+
* id: 'plot-1',
|
|
264
|
+
* });
|
|
265
|
+
*/
|
|
266
|
+
addPlotBand(data) {
|
|
267
|
+
this.store.dispatch('addGaugePlotBand', { data });
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Remove plot band with id.
|
|
271
|
+
* @param {string} id - id of the plot band to be removed
|
|
272
|
+
* @api
|
|
273
|
+
* @example
|
|
274
|
+
* chart.removePlotBand('plot-1');
|
|
275
|
+
*/
|
|
276
|
+
removePlotBand(id) {
|
|
277
|
+
this.store.dispatch('removeGaugePlotBand', { id });
|
|
278
|
+
}
|
|
279
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import Chart from "./chart";
|
|
2
|
+
import { HeatmapChartOptions, HeatmapSeriesData, HeatmapSeriesDataType } from "../../types/options";
|
|
3
|
+
import { HeatmapChartProps, AddSeriesDataInfo, SelectSeriesInfo } from "../../types/charts";
|
|
4
|
+
/**
|
|
5
|
+
* @class
|
|
6
|
+
* @classdesc Heatmap Chart
|
|
7
|
+
* @param {Object} props
|
|
8
|
+
* @param {HTMLElement} props.el - The target element to create chart.
|
|
9
|
+
* @param {Object} props.data - Data for making Heatmap Chart.
|
|
10
|
+
* @param {Object} props.data.categories
|
|
11
|
+
* @param {Array<string>} props.data.categories.x - X Categories.
|
|
12
|
+
* @param {Array<string>} props.data.categories.y - Y Categories.
|
|
13
|
+
* @param {Array<Array<number>>} props.data.series - Series data.
|
|
14
|
+
* @param {Object} [props.options] - Options for making Heatmap 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 {boolean} [props.options.series.shift=false] - Whether to use shift when addData or not.
|
|
27
|
+
* @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.
|
|
28
|
+
* @param {Object} [props.options.xAxis]
|
|
29
|
+
* @param {string|Object} [props.options.xAxis.title] - Axis title.
|
|
30
|
+
* @param {boolean} [props.options.xAxis.rotateLabel=true] - Whether to allow axis label rotation.
|
|
31
|
+
* @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.
|
|
32
|
+
* @param {Object} [props.options.xAxis.tick] - Option to adjust tick interval.
|
|
33
|
+
* @param {Object} [props.options.xAxis.label] - Option to adjust label interval.
|
|
34
|
+
* @param {Object} [props.options.xAxis.scale] - Option to adjust axis minimum, maximum, step size.
|
|
35
|
+
* @param {number} [props.options.xAxis.width] - Width of xAxis.
|
|
36
|
+
* @param {number} [props.options.xAxis.height] - Height of xAxis.
|
|
37
|
+
* @param {Object|Array<Object>} [props.options.yAxis] - If this option is an array type, use the secondary y axis.
|
|
38
|
+
* @param {string|Object} [props.options.yAxis.title] - Axis title.
|
|
39
|
+
* @param {boolean|Object} [props.options.yAxis.date] - Whether the y axis label is of date type. Format option used for date type. Whether the y axis label is of date type. If use date type, format option used for date type.
|
|
40
|
+
* @param {Object} [props.options.yAxis.tick] - Option to adjust tick interval.
|
|
41
|
+
* @param {Object} [props.options.yAxis.label] - Option to adjust label interval.
|
|
42
|
+
* @param {Object} [props.options.yAxis.scale] - Option to adjust axis minimum, maximum, step size.
|
|
43
|
+
* @param {number} [props.options.yAxis.width] - Width of yAxis.
|
|
44
|
+
* @param {number} [props.options.yAxis.height] - Height of yAxis.
|
|
45
|
+
* @param {Object} [props.options.plot]
|
|
46
|
+
* @param {number} [props.options.plot.width] - Width of plot.
|
|
47
|
+
* @param {number} [props.options.plot.height] - Height of plot.
|
|
48
|
+
* @param {boolean} [props.options.plot.visible] - Whether to show plot line.
|
|
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] - 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|Heatmap 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.xAxis] - X Axis theme.
|
|
72
|
+
* @param {Object} [props.options.theme.yAxis] - Y Axis theme.
|
|
73
|
+
* @param {Object} [props.options.theme.legend] - Legend theme.
|
|
74
|
+
* @param {Object} [props.options.theme.tooltip] - Tooltip theme.
|
|
75
|
+
* @param {Object} [props.options.theme.plot] - Plot theme.
|
|
76
|
+
* @param {Object} [props.options.theme.exportMenu] - ExportMenu theme.
|
|
77
|
+
* @extends Chart
|
|
78
|
+
*/
|
|
79
|
+
export default class HeatmapChart extends Chart<HeatmapChartOptions> {
|
|
80
|
+
constructor(props: HeatmapChartProps);
|
|
81
|
+
protected initialize(): void;
|
|
82
|
+
/**
|
|
83
|
+
* Add data.
|
|
84
|
+
* @param {Array} data - Array of data to be added.
|
|
85
|
+
* @param {string} category - Category to be added.
|
|
86
|
+
* @api
|
|
87
|
+
* @example
|
|
88
|
+
* chart.addData([10, 20], '6');
|
|
89
|
+
*/
|
|
90
|
+
addData(data: HeatmapSeriesDataType, category: string): void;
|
|
91
|
+
/**
|
|
92
|
+
* Add series.
|
|
93
|
+
* @param {Object} data - Data to be added.
|
|
94
|
+
* @param {string} data.name - Series name.
|
|
95
|
+
* @param {Array<number>} data.data - Array of data to be added.
|
|
96
|
+
* @param {Object} dataInfo - Category information of the series.
|
|
97
|
+
* @param {Object} dataInfo.category - Y category.
|
|
98
|
+
* @api
|
|
99
|
+
* @example
|
|
100
|
+
* chart.addSeries({
|
|
101
|
+
* name: 'newSeries',
|
|
102
|
+
* data: [10, 100, 50, 40, 70, 55, 33, 70, 90, 110],
|
|
103
|
+
* });
|
|
104
|
+
*/
|
|
105
|
+
addSeries(data: HeatmapSeriesDataType, dataInfo: AddSeriesDataInfo): void;
|
|
106
|
+
/**
|
|
107
|
+
* Convert the chart data to new data.
|
|
108
|
+
* @param {Object} data - Data to be set.
|
|
109
|
+
* @param {Array<string>} data.categories.x - X Categories.
|
|
110
|
+
* @param {Array<string>} data.categories.y - Y Categories.
|
|
111
|
+
* @param {Array<Array<number>>} data.series - Series data.
|
|
112
|
+
* @api
|
|
113
|
+
* @example
|
|
114
|
+
* chart.setData({
|
|
115
|
+
* categories: {
|
|
116
|
+
* x: ['1', '2', '3' ],
|
|
117
|
+
* y: ['A', 'B'],
|
|
118
|
+
* },
|
|
119
|
+
* series: [
|
|
120
|
+
* [1, 2, 3],
|
|
121
|
+
* [4, 5, 6],
|
|
122
|
+
* ]
|
|
123
|
+
* });
|
|
124
|
+
*/
|
|
125
|
+
setData(data: HeatmapSeriesData): void;
|
|
126
|
+
/**
|
|
127
|
+
* Hide series data label.
|
|
128
|
+
* @api
|
|
129
|
+
* @example
|
|
130
|
+
* chart.hideSeriesDataLabel();
|
|
131
|
+
*/
|
|
132
|
+
hideSeriesDataLabel(): void;
|
|
133
|
+
/**
|
|
134
|
+
* Show series data label.
|
|
135
|
+
* @api
|
|
136
|
+
* @example
|
|
137
|
+
* chart.showSeriesDataLabel();
|
|
138
|
+
*/
|
|
139
|
+
showSeriesDataLabel(): void;
|
|
140
|
+
/**
|
|
141
|
+
* Convert the chart options to new options.
|
|
142
|
+
* @param {Object} options - Chart options
|
|
143
|
+
* @api
|
|
144
|
+
* @example
|
|
145
|
+
* chart.setOptions({
|
|
146
|
+
* chart: {
|
|
147
|
+
* width: 500,
|
|
148
|
+
* height: 'auto',
|
|
149
|
+
* title: 'Energy Usage',
|
|
150
|
+
* },
|
|
151
|
+
* xAxis: {
|
|
152
|
+
* title: 'Month',
|
|
153
|
+
* },
|
|
154
|
+
* yAxis: {
|
|
155
|
+
* title: 'Energy (kWh)',
|
|
156
|
+
* },
|
|
157
|
+
* series: {
|
|
158
|
+
* selectable: true,
|
|
159
|
+
* },
|
|
160
|
+
* tooltip: {
|
|
161
|
+
* formatter: (value) => `${value}kWh`,
|
|
162
|
+
* },
|
|
163
|
+
* });
|
|
164
|
+
*/
|
|
165
|
+
setOptions(options: HeatmapChartOptions): void;
|
|
166
|
+
/**
|
|
167
|
+
* Update chart options.
|
|
168
|
+
* @param {Object} options - Chart options
|
|
169
|
+
* @api
|
|
170
|
+
* @example
|
|
171
|
+
* chart.updateOptions({
|
|
172
|
+
* chart: {
|
|
173
|
+
* height: 'auto',
|
|
174
|
+
* title: 'Energy Usage',
|
|
175
|
+
* },
|
|
176
|
+
* tooltip: {
|
|
177
|
+
* formatter: (value) => `${value}kWh`,
|
|
178
|
+
* },
|
|
179
|
+
* });
|
|
180
|
+
*/
|
|
181
|
+
updateOptions(options: HeatmapChartOptions): void;
|
|
182
|
+
/**
|
|
183
|
+
* Show tooltip.
|
|
184
|
+
* @param {Object} seriesInfo - Information of the series for the tooltip to be displayed.
|
|
185
|
+
* @param {number} seriesInfo.seriesIndex - Index of series.
|
|
186
|
+
* @param {number} seriesInfo.index - Index of data within series.
|
|
187
|
+
* @api
|
|
188
|
+
* @example
|
|
189
|
+
* chart.showTooltip({index: 1, seriesIndex: 2});
|
|
190
|
+
*/
|
|
191
|
+
showTooltip(seriesInfo: SelectSeriesInfo): void;
|
|
192
|
+
/**
|
|
193
|
+
* Hide tooltip.
|
|
194
|
+
* @api
|
|
195
|
+
* @example
|
|
196
|
+
* chart.hideTooltip();
|
|
197
|
+
*/
|
|
198
|
+
hideTooltip(): void;
|
|
199
|
+
}
|