@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,278 @@
|
|
|
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 Axis from "../component/axis";
|
|
7
|
+
import BulletSeries from "../component/bulletSeries";
|
|
8
|
+
import Plot from "../component/plot";
|
|
9
|
+
import Tooltip from "../component/tooltip";
|
|
10
|
+
import Legend from "../component/legend";
|
|
11
|
+
import AxisTitle from "../component/axisTitle";
|
|
12
|
+
import Title from "../component/title";
|
|
13
|
+
import ExportMenu from "../component/exportMenu";
|
|
14
|
+
import SelectedSeries from "../component/selectedSeries";
|
|
15
|
+
import HoveredSeries from "../component/hoveredSeries";
|
|
16
|
+
import DataLabels from "../component/dataLabels";
|
|
17
|
+
import Background from "../component/background";
|
|
18
|
+
import NoDataText from "../component/noDataText";
|
|
19
|
+
import * as basicBrushes from "../brushes/basic";
|
|
20
|
+
import * as axisBrushes from "../brushes/axis";
|
|
21
|
+
import * as legendBrush from "../brushes/legend";
|
|
22
|
+
import * as labelBrush from "../brushes/label";
|
|
23
|
+
import * as dataLabelBrush from "../brushes/dataLabel";
|
|
24
|
+
import * as exportMenuBrush from "../brushes/exportMenu";
|
|
25
|
+
/**
|
|
26
|
+
* @class
|
|
27
|
+
* @classdesc Bullet Chart
|
|
28
|
+
* @param {Object} props
|
|
29
|
+
* @param {HTMLElement} props.el - The target element to create chart.
|
|
30
|
+
* @param {Object} props.data - Data for making Bullet 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 {Array<number>} props.data.series.markers - Series markers. It specifies the marker for comparing.
|
|
36
|
+
* @param {Array<Array<number>>} props.data.series.ranges - Series ranges. It specifies the range of values that can be compared.
|
|
37
|
+
* @param {Object} [props.options] - Options for making Bullet Chart.
|
|
38
|
+
* @param {Object} [props.options.chart]
|
|
39
|
+
* @param {string|Object} [props.options.chart.title] - Chart title text or options.
|
|
40
|
+
* @param {string} [props.options.chart.title.text] - Chart title text.
|
|
41
|
+
* @param {number} [props.options.chart.title.offsetX] - Offset value to move title horizontally.
|
|
42
|
+
* @param {number} [props.options.chart.title.offsetY] - Offset value to move title vertically.
|
|
43
|
+
* @param {string} [props.options.chart.title.align] - Chart text align. 'left', 'right', 'center' is available.
|
|
44
|
+
* @param {boolean|Object} [props.options.chart.animation] - Whether to use animation and duration when rendering the initial chart.
|
|
45
|
+
* @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.
|
|
46
|
+
* @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.
|
|
47
|
+
* @param {Object} [props.options.series]
|
|
48
|
+
* @param {boolean} [props.options.series.selectable=false] - Whether to make selectable series or not.
|
|
49
|
+
* @param {number} [props.options.series.vertical] - Whether to use vertical bullet series or not.
|
|
50
|
+
* @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.
|
|
51
|
+
* @param {Object} [props.options.xAxis]
|
|
52
|
+
* @param {string|Object} [props.options.xAxis.title] - Axis title.
|
|
53
|
+
* @param {boolean} [props.options.xAxis.rotateLabel=true] - Whether to allow axis label rotation.
|
|
54
|
+
* @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.
|
|
55
|
+
* @param {Object} [props.options.xAxis.tick] - Option to adjust tick interval.
|
|
56
|
+
* @param {Object} [props.options.xAxis.label] - Option to adjust label interval.
|
|
57
|
+
* @param {Object} [props.options.xAxis.scale] - Option to adjust axis minimum, maximum, step size.
|
|
58
|
+
* @param {number} [props.options.xAxis.width] - Width of xAxis.
|
|
59
|
+
* @param {number} [props.options.xAxis.height] - Height of xAxis.
|
|
60
|
+
* @param {Object} [props.options.yAxis]
|
|
61
|
+
* @param {string|Object} [props.options.yAxis.title] - Axis title.
|
|
62
|
+
* @param {Object} [props.options.yAxis.tick] - Option to adjust tick interval.
|
|
63
|
+
* @param {Object} [props.options.yAxis.label] - Option to adjust label interval.
|
|
64
|
+
* @param {Object} [props.options.yAxis.scale] - Option to adjust axis minimum, maximum, step size.
|
|
65
|
+
* @param {number} [props.options.yAxis.width] - Width of yAxis.
|
|
66
|
+
* @param {number} [props.options.yAxis.height] - Height of yAxis.
|
|
67
|
+
* @param {Object} [props.options.plot]
|
|
68
|
+
* @param {number} [props.options.plot.width] - Width of plot.
|
|
69
|
+
* @param {number} [props.options.plot.height] - Height of plot.
|
|
70
|
+
* @param {boolean} [props.options.plot.visible] - Whether to show plot line.
|
|
71
|
+
* @param {Object} [props.options.legend]
|
|
72
|
+
* @param {string} [props.options.legend.align] - Legend align. 'top', 'bottom', 'right', 'left' is available.
|
|
73
|
+
* @param {string} [props.options.legend.showCheckbox] - Whether to show checkbox.
|
|
74
|
+
* @param {boolean} [props.options.legend.visible] - Whether to show legend.
|
|
75
|
+
* @param {number} [props.options.legend.width] - Width of legend.
|
|
76
|
+
* @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.
|
|
77
|
+
* @param {Object} [props.options.exportMenu]
|
|
78
|
+
* @param {boolean} [props.options.exportMenu.visible] - Whether to show export menu.
|
|
79
|
+
* @param {string} [props.options.exportMenu.filename] - File name applied when downloading.
|
|
80
|
+
* @param {Object} [props.options.tooltip]
|
|
81
|
+
* @param {number} [props.options.tooltip.offsetX] - Offset value to move title horizontally.
|
|
82
|
+
* @param {number} [props.options.tooltip.offsetY] - Offset value to move title vertically.
|
|
83
|
+
* @param {Function} [props.options.tooltip.formatter] - Function to format data value.
|
|
84
|
+
* @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.
|
|
85
|
+
* @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.
|
|
86
|
+
* @param {boolean|Object} [props.options.responsive.animation] - Animation duration when the chart is modified.
|
|
87
|
+
* @param {Array<Object>} [props.options.responsive.rules] - Rules for the Chart to Respond.
|
|
88
|
+
* @param {Object} [props.options.lang] - Options for changing the text displayed on the chart or i18n languages.
|
|
89
|
+
* @param {Object} [props.options.lang.noData] - No Data Layer Text.
|
|
90
|
+
* @param {Object} [props.options.theme] - Chart theme options. For specific information, refer to the {@link https://github.com/nhn/tui.chart|Bullets Chart guide} on github.
|
|
91
|
+
* @param {Object} [props.options.theme.chart] - Chart font theme.
|
|
92
|
+
* @param {Object} [props.options.theme.noData] - No Data Layer Text theme.
|
|
93
|
+
* @param {Object} [props.options.theme.series] - Series theme.
|
|
94
|
+
* @param {Object} [props.options.theme.title] - Title theme.
|
|
95
|
+
* @param {Object} [props.options.theme.xAxis] - X Axis theme.
|
|
96
|
+
* @param {Object} [props.options.theme.yAxis] - Y Axis theme.
|
|
97
|
+
* @param {Object} [props.options.theme.legend] - Legend theme.
|
|
98
|
+
* @param {Object} [props.options.theme.tooltip] - Tooltip theme.
|
|
99
|
+
* @param {Object} [props.options.theme.plot] - Plot theme.
|
|
100
|
+
* @param {Object} [props.options.theme.exportMenu] - ExportMenu theme.
|
|
101
|
+
* @extends Chart
|
|
102
|
+
*/
|
|
103
|
+
export default class BulletChart extends Chart {
|
|
104
|
+
constructor({ el, options, data: { series } }) {
|
|
105
|
+
super({
|
|
106
|
+
el,
|
|
107
|
+
options,
|
|
108
|
+
series: {
|
|
109
|
+
bullet: series,
|
|
110
|
+
},
|
|
111
|
+
modules: [dataRange, scale, axes, plot],
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Hide tooltip.
|
|
115
|
+
* @api
|
|
116
|
+
* @example
|
|
117
|
+
* chart.hideTooltip();
|
|
118
|
+
*/
|
|
119
|
+
this.hideTooltip = () => {
|
|
120
|
+
this.eventBus.emit('hideTooltip');
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
initialize() {
|
|
124
|
+
super.initialize();
|
|
125
|
+
this.componentManager.add(Background);
|
|
126
|
+
this.componentManager.add(Title);
|
|
127
|
+
this.componentManager.add(Plot);
|
|
128
|
+
this.componentManager.add(Legend);
|
|
129
|
+
this.componentManager.add(BulletSeries);
|
|
130
|
+
this.componentManager.add(Axis, { name: 'yAxis' });
|
|
131
|
+
this.componentManager.add(Axis, { name: 'xAxis' });
|
|
132
|
+
this.componentManager.add(AxisTitle, { name: 'xAxis' });
|
|
133
|
+
this.componentManager.add(AxisTitle, { name: 'yAxis' });
|
|
134
|
+
this.componentManager.add(ExportMenu, { chartEl: this.el });
|
|
135
|
+
this.componentManager.add(HoveredSeries);
|
|
136
|
+
this.componentManager.add(SelectedSeries);
|
|
137
|
+
this.componentManager.add(DataLabels);
|
|
138
|
+
this.componentManager.add(Tooltip, { chartEl: this.el });
|
|
139
|
+
this.componentManager.add(NoDataText);
|
|
140
|
+
this.painter.addGroups([
|
|
141
|
+
basicBrushes,
|
|
142
|
+
axisBrushes,
|
|
143
|
+
legendBrush,
|
|
144
|
+
labelBrush,
|
|
145
|
+
exportMenuBrush,
|
|
146
|
+
dataLabelBrush,
|
|
147
|
+
]);
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Add series.
|
|
151
|
+
* @param {Object} data - Data to be added
|
|
152
|
+
* @param {string} data.name - Series name
|
|
153
|
+
* @param {Array<<Array<number>>} data.data - Array of data to be added
|
|
154
|
+
* @param {Array<number>} data.markers - Series markers. It specifies the marker for comparing.
|
|
155
|
+
* @param {Array<Array<number>>} data.ranges - Series ranges. It specifies the range of values that can be compared.
|
|
156
|
+
* @api
|
|
157
|
+
* @example
|
|
158
|
+
* chart.addSeries({
|
|
159
|
+
* name: 'newSeries',
|
|
160
|
+
* data: 20,
|
|
161
|
+
* markers: [28, 2, 15],
|
|
162
|
+
* ranges: [
|
|
163
|
+
* [-1, 10],
|
|
164
|
+
* [10, 20],
|
|
165
|
+
* [20, 30],
|
|
166
|
+
* ],
|
|
167
|
+
* });
|
|
168
|
+
*/
|
|
169
|
+
addSeries(data) {
|
|
170
|
+
this.resetSeries();
|
|
171
|
+
this.store.dispatch('addSeries', { data });
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Convert the chart data to new data.
|
|
175
|
+
* @param {Object} data - Data to be set
|
|
176
|
+
* @api
|
|
177
|
+
* @example
|
|
178
|
+
* chart.setData({
|
|
179
|
+
* series: [
|
|
180
|
+
* {
|
|
181
|
+
* name: 'newSeries',
|
|
182
|
+
* data: 20,
|
|
183
|
+
* markers: [28, 2, 15],
|
|
184
|
+
* ranges: [
|
|
185
|
+
* [-1, 10],
|
|
186
|
+
* [10, 20],
|
|
187
|
+
* [20, 30],
|
|
188
|
+
* ],
|
|
189
|
+
* }
|
|
190
|
+
* ]
|
|
191
|
+
* });
|
|
192
|
+
*/
|
|
193
|
+
setData(data) {
|
|
194
|
+
this.resetSeries();
|
|
195
|
+
this.store.dispatch('setData', { series: { bullet: data.series } });
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Hide series data label.
|
|
199
|
+
* @api
|
|
200
|
+
* @example
|
|
201
|
+
* chart.hideSeriesDataLabel();
|
|
202
|
+
*/
|
|
203
|
+
hideSeriesDataLabel() {
|
|
204
|
+
this.store.dispatch('updateOptions', {
|
|
205
|
+
options: { series: { dataLabels: { visible: false } } },
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Show series data label.
|
|
210
|
+
* @api
|
|
211
|
+
* @example
|
|
212
|
+
* chart.showSeriesDataLabel();
|
|
213
|
+
*/
|
|
214
|
+
showSeriesDataLabel() {
|
|
215
|
+
this.store.dispatch('updateOptions', {
|
|
216
|
+
options: { series: { dataLabels: { visible: true } } },
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Convert the chart options to new options.
|
|
221
|
+
* @param {Object} options - Chart options
|
|
222
|
+
* @api
|
|
223
|
+
* @example
|
|
224
|
+
* chart.setOptions({
|
|
225
|
+
* chart: {
|
|
226
|
+
* width: 500,
|
|
227
|
+
* height: 'auto',
|
|
228
|
+
* title: 'Energy Usage',
|
|
229
|
+
* },
|
|
230
|
+
* xAxis: {
|
|
231
|
+
* title: 'Month',
|
|
232
|
+
* },
|
|
233
|
+
* yAxis: {
|
|
234
|
+
* title: 'Energy (kWh)',
|
|
235
|
+
* },
|
|
236
|
+
* series: {
|
|
237
|
+
* selectable: true,
|
|
238
|
+
* },
|
|
239
|
+
* tooltip: {
|
|
240
|
+
* formatter: (value) => `${value}kWh`,
|
|
241
|
+
* },
|
|
242
|
+
* });
|
|
243
|
+
*/
|
|
244
|
+
setOptions(options) {
|
|
245
|
+
this.resetSeries();
|
|
246
|
+
this.dispatchOptionsEvent('initOptions', options);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Update chart options.
|
|
250
|
+
* @param {Object} options - Chart options
|
|
251
|
+
* @api
|
|
252
|
+
* @example
|
|
253
|
+
* chart.updateOptions({
|
|
254
|
+
* chart: {
|
|
255
|
+
* height: 'auto',
|
|
256
|
+
* title: 'Energy Usage',
|
|
257
|
+
* },
|
|
258
|
+
* tooltip: {
|
|
259
|
+
* formatter: (value) => `${value}kWh`,
|
|
260
|
+
* },
|
|
261
|
+
* });
|
|
262
|
+
*/
|
|
263
|
+
updateOptions(options) {
|
|
264
|
+
this.resetSeries();
|
|
265
|
+
this.dispatchOptionsEvent('updateOptions', options);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Show tooltip.
|
|
269
|
+
* @param {Object} seriesInfo - Information of the series for the tooltip to be displayed.
|
|
270
|
+
* @param {number} seriesInfo.seriesIndex - Index of series.
|
|
271
|
+
* @api
|
|
272
|
+
* @example
|
|
273
|
+
* chart.showTooltip({seriesIndex: 1});
|
|
274
|
+
*/
|
|
275
|
+
showTooltip(seriesInfo) {
|
|
276
|
+
this.eventBus.emit('showTooltip', Object.assign(Object.assign({}, seriesInfo), { state: this.store.state }));
|
|
277
|
+
}
|
|
278
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import Store from "../store/store";
|
|
2
|
+
import EventEmitter from "../eventEmitter";
|
|
3
|
+
import ComponentManager from "../component/componentManager";
|
|
4
|
+
import Animator from "../animator";
|
|
5
|
+
import { ChartProps, Point, SeriesDataInput, Size, DataInput } from "../../types/options";
|
|
6
|
+
import { RespondersModel } from "../component/component";
|
|
7
|
+
import { ChartState, Options, StoreModule } from "../../types/store/store";
|
|
8
|
+
import Component from "../component/component";
|
|
9
|
+
import { CheckedLegendType } from "../../types/components/legend";
|
|
10
|
+
import { SelectSeriesInfo, AddSeriesDataInfo } from "../../types/charts";
|
|
11
|
+
import { CustomEventType, EventListener } from "../../types/eventEmitter";
|
|
12
|
+
export declare const DEFAULT_ANIM_DURATION = 500;
|
|
13
|
+
export interface SelectSeriesHandlerParams<T extends Options> extends SelectSeriesInfo {
|
|
14
|
+
state: ChartState<T>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @class
|
|
18
|
+
* @abstract
|
|
19
|
+
* Abstract class used to implement each chart.
|
|
20
|
+
*/
|
|
21
|
+
export default abstract class Chart<T extends Options> {
|
|
22
|
+
store: Store<T>;
|
|
23
|
+
___animId___: null;
|
|
24
|
+
animator: Animator;
|
|
25
|
+
readonly containerEl: HTMLElement;
|
|
26
|
+
el: HTMLDivElement;
|
|
27
|
+
ctx: CanvasRenderingContext2D;
|
|
28
|
+
painter: any;
|
|
29
|
+
readonly eventBus: EventEmitter;
|
|
30
|
+
readonly componentManager: ComponentManager<T>;
|
|
31
|
+
modules: StoreModule[];
|
|
32
|
+
enteredComponents: Component[];
|
|
33
|
+
animationControlFlag: {
|
|
34
|
+
resizing: boolean;
|
|
35
|
+
updating: boolean;
|
|
36
|
+
};
|
|
37
|
+
resizeObserver: ResizeObserver | null;
|
|
38
|
+
private getAnimationDuration;
|
|
39
|
+
createChartWrapper(): HTMLDivElement;
|
|
40
|
+
constructor(props: ChartProps<T>);
|
|
41
|
+
resizeChartSize(containerWidth?: number, containerHeight?: number): void;
|
|
42
|
+
private debounceResizeEvent;
|
|
43
|
+
setResizeEvent(): void;
|
|
44
|
+
clearResizeEvent(): void;
|
|
45
|
+
handleCanvasMouseEvent(eventType: string, mousePosition: Point): void;
|
|
46
|
+
handleResponderEvent(event: MouseEvent, mousePosition: Point): void;
|
|
47
|
+
handleEvent(event: MouseEvent): void;
|
|
48
|
+
protected initStore(): void;
|
|
49
|
+
protected initialize(): void;
|
|
50
|
+
draw(): void;
|
|
51
|
+
update(delta: number): void;
|
|
52
|
+
initUpdate(delta: number): void;
|
|
53
|
+
protected handleEventForAllResponders?(event: MouseEvent, responderModels: RespondersModel, delegationMethod: string, mousePosition: Point): void;
|
|
54
|
+
/**
|
|
55
|
+
* Get checked legend chart type and label, checked state.
|
|
56
|
+
* @returns {Array<{checked: boolean, chartType: string, label: string}>} Array data that whether series has checked
|
|
57
|
+
* @api
|
|
58
|
+
* @example
|
|
59
|
+
* const checkedLegend = chart.getCheckedLegend()
|
|
60
|
+
*/
|
|
61
|
+
getCheckedLegend: () => CheckedLegendType;
|
|
62
|
+
abstract updateOptions(options: Options): void;
|
|
63
|
+
abstract setOptions(options: Options): void;
|
|
64
|
+
abstract showTooltip(info: SelectSeriesInfo): void;
|
|
65
|
+
abstract hideTooltip(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the currently applied chart options.
|
|
68
|
+
* @returns {Object} options
|
|
69
|
+
* @api
|
|
70
|
+
* @example
|
|
71
|
+
* const options = chart.getOptions();
|
|
72
|
+
*/
|
|
73
|
+
getOptions: () => any;
|
|
74
|
+
abstract addSeries(data: SeriesDataInput, dataInfo?: AddSeriesDataInfo): void;
|
|
75
|
+
/**
|
|
76
|
+
* Register of user custom event.
|
|
77
|
+
* @param {string} eventName - Event name. 'clickLegendLabel', 'clickLegendCheckbox', 'selectSeries', 'unselectSeries', 'hoverSeries', 'unhoverSeries', 'zoom', 'resetZoom' is available.
|
|
78
|
+
* @param {Function} handler - Event handler
|
|
79
|
+
* @api
|
|
80
|
+
*/
|
|
81
|
+
on: (eventName: CustomEventType, handler: EventListener) => void;
|
|
82
|
+
abstract setData(data: DataInput): void;
|
|
83
|
+
/**
|
|
84
|
+
* Destroys the instance.
|
|
85
|
+
* @api
|
|
86
|
+
* @example
|
|
87
|
+
* chart.destroy();
|
|
88
|
+
*/
|
|
89
|
+
destroy: () => void;
|
|
90
|
+
private isSelectableSeries;
|
|
91
|
+
/**
|
|
92
|
+
* Select series. It works only when the selectable option is true.
|
|
93
|
+
* @param {Object} seriesInfo - Information of the series to be selected
|
|
94
|
+
* @param {number} [seriesInfo.seriesIndex] - Index of series
|
|
95
|
+
* @param {number} [seriesInfo.index] - Index of data within series
|
|
96
|
+
* @param {string} [seriesInfo.name] - Specify name for NestedPie Chart
|
|
97
|
+
* @param {string} [seriesInfo.chartType] - Specify which chart to select when using LineArea, LineScatter, and ColumnLine charts.specifies which chart to select when using LineArea, LineScatter, and ColumnLine charts.
|
|
98
|
+
* @api
|
|
99
|
+
* @example
|
|
100
|
+
* chart.selectSeries({index: 1, seriesIndex: 2});
|
|
101
|
+
*/
|
|
102
|
+
selectSeries: (seriesInfo: SelectSeriesInfo) => void;
|
|
103
|
+
/**
|
|
104
|
+
* Unselect selected series. It works only when the selectable option is true.
|
|
105
|
+
* @api
|
|
106
|
+
* @example
|
|
107
|
+
* chart.unselectSeries();
|
|
108
|
+
*/
|
|
109
|
+
unselectSeries: () => void;
|
|
110
|
+
/**
|
|
111
|
+
* Resize chart size.
|
|
112
|
+
* @param {Object} size Chart size
|
|
113
|
+
* @param {number} [size.width] Width
|
|
114
|
+
* @param {number} [size.height] Height
|
|
115
|
+
* @api
|
|
116
|
+
* @example
|
|
117
|
+
* chart.resize({height: 100, width: 200});
|
|
118
|
+
*/
|
|
119
|
+
resize: (size: Partial<Size>) => void;
|
|
120
|
+
/**
|
|
121
|
+
* Set tooltip offset.
|
|
122
|
+
* @param {Object} offset - Offset size
|
|
123
|
+
* @param {number} [offset.x] Offset value to move title horizontally
|
|
124
|
+
* @param {number} [offset.y] Offset value to move title vertically
|
|
125
|
+
* @api
|
|
126
|
+
* @example
|
|
127
|
+
* chart.setTooltipOffset({x: 10, y: -20});
|
|
128
|
+
*/
|
|
129
|
+
setTooltipOffset(offset: Partial<Point>): void;
|
|
130
|
+
resetSeries: () => void;
|
|
131
|
+
private setResizeEventListeners;
|
|
132
|
+
protected dispatchOptionsEvent(eventName: 'initOptions' | 'updateOptions', options: Options): void;
|
|
133
|
+
}
|