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