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