@vaadin/charts 23.2.15 → 23.2.16
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/LICENSE +1105 -248
- package/README.md +2 -2
- package/package.json +8 -8
- package/src/vaadin-chart-series.d.ts +8 -3
- package/src/vaadin-chart-series.js +76 -71
- package/src/vaadin-chart.d.ts +9 -20
- package/src/vaadin-chart.js +67 -78
- package/theme/vaadin-chart-base-theme.js +7 -2
- package/vaadin-chart-series.d.ts +1 -0
- package/vaadin-chart-series.js +1 -0
- package/web-types.json +229 -229
- package/web-types.lit.json +86 -86
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ A feature-rich interactive charting library providing multiple different chart t
|
|
|
24
24
|
</vaadin-chart>
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
[<img src="https://raw.githubusercontent.com/vaadin/web-components/
|
|
27
|
+
[<img src="https://raw.githubusercontent.com/vaadin/web-components/main/packages/charts/screenshot.png" width="530" alt="Screenshot of vaadin-chart">](https://vaadin.com/docs/latest/components/charts)
|
|
28
28
|
|
|
29
29
|
## Installation
|
|
30
30
|
|
|
@@ -46,7 +46,7 @@ Read the [contributing guide](https://vaadin.com/docs/latest/contributing/overvi
|
|
|
46
46
|
|
|
47
47
|
## License
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
This program is available under Vaadin Commercial License and Service Terms. For license terms, see LICENSE.
|
|
50
50
|
|
|
51
51
|
Vaadin collects usage statistics at development time to improve this product.
|
|
52
52
|
For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/charts",
|
|
3
|
-
"version": "23.2.
|
|
3
|
+
"version": "23.2.16",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"description": "vaadin-charts",
|
|
8
8
|
"license": "SEE LICENSE IN LICENSE",
|
|
9
|
-
"cvdlName": "vaadin-chart",
|
|
10
9
|
"repository": {
|
|
11
10
|
"type": "git",
|
|
12
11
|
"url": "https://github.com/vaadin/web-components.git",
|
|
@@ -37,20 +36,21 @@
|
|
|
37
36
|
],
|
|
38
37
|
"dependencies": {
|
|
39
38
|
"@polymer/polymer": "^3.0.0",
|
|
40
|
-
"@vaadin/component-base": "~23.2.
|
|
41
|
-
"@vaadin/vaadin-lumo-styles": "~23.2.
|
|
42
|
-
"@vaadin/vaadin-material-styles": "~23.2.
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "~23.2.
|
|
39
|
+
"@vaadin/component-base": "~23.2.16",
|
|
40
|
+
"@vaadin/vaadin-lumo-styles": "~23.2.16",
|
|
41
|
+
"@vaadin/vaadin-material-styles": "~23.2.16",
|
|
42
|
+
"@vaadin/vaadin-themable-mixin": "~23.2.16",
|
|
44
43
|
"highcharts": "9.2.2"
|
|
45
44
|
},
|
|
46
45
|
"devDependencies": {
|
|
47
46
|
"@esm-bundle/chai": "^4.3.4",
|
|
48
|
-
"@vaadin/testing-helpers": "^0.
|
|
47
|
+
"@vaadin/testing-helpers": "^0.4.0",
|
|
49
48
|
"sinon": "^13.0.2"
|
|
50
49
|
},
|
|
50
|
+
"cvdlName": "vaadin-chart",
|
|
51
51
|
"web-types": [
|
|
52
52
|
"web-types.json",
|
|
53
53
|
"web-types.lit.json"
|
|
54
54
|
],
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "57010013e59a3ecdc70ceef4377dbc3b1ac03fb3"
|
|
56
56
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
5
10
|
*/
|
|
6
11
|
import type { PointOptionsObject, Series, SeriesOptionsType } from 'highcharts';
|
|
7
12
|
|
|
@@ -126,7 +131,7 @@ declare class ChartSeries extends HTMLElement {
|
|
|
126
131
|
markers: ChartSeriesMarkers | null | undefined;
|
|
127
132
|
|
|
128
133
|
/**
|
|
129
|
-
* Used to connect the series to an axis; if multiple series have the same
|
|
134
|
+
* Used to connect the series to an axis; if multiple series have the same `unit`, they will share axis.
|
|
130
135
|
* Displayed as a title for the axis.
|
|
131
136
|
* If no unit is defined, then series will be connected to the first axis.
|
|
132
137
|
*/
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
5
10
|
*/
|
|
6
11
|
import { PolymerElement } from '@polymer/polymer/polymer-element.js';
|
|
7
12
|
import { Chart, deepMerge } from './vaadin-chart.js';
|
|
@@ -56,55 +61,6 @@ class ChartSeries extends PolymerElement {
|
|
|
56
61
|
return 'vaadin-chart-series';
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
get options() {
|
|
60
|
-
const options = deepMerge({}, this.additionalOptions);
|
|
61
|
-
|
|
62
|
-
if (this.type) {
|
|
63
|
-
options.type = this.type;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
if (this.title) {
|
|
67
|
-
options.name = this.title;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (this.values) {
|
|
71
|
-
options.data = this.values;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
if (this.markers) {
|
|
75
|
-
if (!this.__isMarkersValid()) {
|
|
76
|
-
this.markers = 'auto';
|
|
77
|
-
}
|
|
78
|
-
options.marker = this.__markersConfiguration;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (this.unit) {
|
|
82
|
-
options.yAxis = this.unit;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
if (this.stack) {
|
|
86
|
-
options.stack = this.stack;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (isFinite(this.valueMin)) {
|
|
90
|
-
options.yAxisValueMin = this.valueMin;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (isFinite(this.valueMax)) {
|
|
94
|
-
options.yAxisValueMax = this.valueMax;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (this.neckWidth) {
|
|
98
|
-
options.neckWidth = this.neckWidth;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (this.neckPosition) {
|
|
102
|
-
options.neckHeight = this.neckPosition;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return options;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
64
|
static get properties() {
|
|
109
65
|
return {
|
|
110
66
|
/**
|
|
@@ -181,7 +137,7 @@ class ChartSeries extends PolymerElement {
|
|
|
181
137
|
},
|
|
182
138
|
|
|
183
139
|
/**
|
|
184
|
-
* Used to connect the series to an axis; if multiple series have the same
|
|
140
|
+
* Used to connect the series to an axis; if multiple series have the same `unit`, they will share axis.
|
|
185
141
|
* Displayed as a title for the axis.
|
|
186
142
|
* If no unit is defined, then series will be connected to the first axis.
|
|
187
143
|
*/
|
|
@@ -269,6 +225,74 @@ class ChartSeries extends PolymerElement {
|
|
|
269
225
|
];
|
|
270
226
|
}
|
|
271
227
|
|
|
228
|
+
get options() {
|
|
229
|
+
const options = deepMerge({}, this.additionalOptions);
|
|
230
|
+
|
|
231
|
+
if (this.type) {
|
|
232
|
+
options.type = this.type;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if (this.title) {
|
|
236
|
+
options.name = this.title;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (this.values) {
|
|
240
|
+
options.data = this.values;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (this.markers) {
|
|
244
|
+
if (!this.__isMarkersValid()) {
|
|
245
|
+
this.markers = 'auto';
|
|
246
|
+
}
|
|
247
|
+
options.marker = this.__markersConfiguration;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (this.unit) {
|
|
251
|
+
options.yAxis = this.unit;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (this.stack) {
|
|
255
|
+
options.stack = this.stack;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (isFinite(this.valueMin)) {
|
|
259
|
+
options.yAxisValueMin = this.valueMin;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if (isFinite(this.valueMax)) {
|
|
263
|
+
options.yAxisValueMax = this.valueMax;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (this.neckWidth) {
|
|
267
|
+
options.neckWidth = this.neckWidth;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (this.neckPosition) {
|
|
271
|
+
options.neckHeight = this.neckPosition;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return options;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** @private */
|
|
278
|
+
get __markersConfiguration() {
|
|
279
|
+
const config = {};
|
|
280
|
+
switch (this.markers) {
|
|
281
|
+
case 'shown':
|
|
282
|
+
config.enabled = true;
|
|
283
|
+
break;
|
|
284
|
+
case 'hidden':
|
|
285
|
+
config.enabled = false;
|
|
286
|
+
break;
|
|
287
|
+
case 'auto':
|
|
288
|
+
default:
|
|
289
|
+
config.enabled = null;
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return config;
|
|
294
|
+
}
|
|
295
|
+
|
|
272
296
|
/**
|
|
273
297
|
* Method to attach a series object of type `Highcharts.Series`.
|
|
274
298
|
* @param {!Series} series Object of type `Highcharts.Series`
|
|
@@ -413,25 +437,6 @@ class ChartSeries extends PolymerElement {
|
|
|
413
437
|
});
|
|
414
438
|
}
|
|
415
439
|
|
|
416
|
-
/** @private */
|
|
417
|
-
get __markersConfiguration() {
|
|
418
|
-
const config = {};
|
|
419
|
-
switch (this.markers) {
|
|
420
|
-
case 'shown':
|
|
421
|
-
config.enabled = true;
|
|
422
|
-
break;
|
|
423
|
-
case 'hidden':
|
|
424
|
-
config.enabled = false;
|
|
425
|
-
break;
|
|
426
|
-
case 'auto':
|
|
427
|
-
default:
|
|
428
|
-
config.enabled = null;
|
|
429
|
-
break;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
return config;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
440
|
/** @private */
|
|
436
441
|
__showWarn(propertyName, acceptedValues) {
|
|
437
442
|
console.warn(`<vaadin-chart-series> Acceptable values for "${propertyName}" are ${acceptedValues}`);
|
package/src/vaadin-chart.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
5
10
|
*/
|
|
6
11
|
import type { Axis, Chart as HighchartsChart, ExtremesObject, Options, Point, Series } from 'highcharts';
|
|
7
12
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
@@ -359,22 +364,6 @@ export type ChartEventMap = ChartCustomEventMap & HTMLElementEventMap;
|
|
|
359
364
|
* 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).
|
|
360
365
|
* 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).
|
|
361
366
|
*
|
|
362
|
-
* Using as a base the project created with in Quick Start and an `additionalOptions` in order to make RTL adjustments:
|
|
363
|
-
*
|
|
364
|
-
* ```html
|
|
365
|
-
* <vaadin-chart title="۱- عنوان نمودار" subtitle="۲- عنوان فرعی نمودار"
|
|
366
|
-
* additional-options='{"title": {"useHTML": true}, "tooltip": {"useHTML": true}, "subtitle": {"useHTML": true},
|
|
367
|
-
* "legend": {"rtl": true}, "yAxis": [{"id": "۴- مقادیر", "title": {"text": "۴- مقادیر", "useHTML": true}}],
|
|
368
|
-
* "xAxis": {"reversed": true}}'>
|
|
369
|
-
* <vaadin-chart-series
|
|
370
|
-
* type= "column"
|
|
371
|
-
* title="۳- عنوان ردیف"
|
|
372
|
-
* unit="۴- مقادیر"
|
|
373
|
-
* values="[10,20,30]">
|
|
374
|
-
* </vaadin-chart-series>
|
|
375
|
-
* </vaadin-chart>
|
|
376
|
-
* ```
|
|
377
|
-
*
|
|
378
367
|
* ### Setting colors
|
|
379
368
|
*
|
|
380
369
|
* Although charts can be styled as described above, there is a simpler way for setting colors.
|
|
@@ -550,12 +539,12 @@ declare class Chart extends ResizeMixin(ThemableMixin(ElementMixin(HTMLElement))
|
|
|
550
539
|
*
|
|
551
540
|
* @param {!Options} jsonConfiguration Object chart configuration. Most important properties are:
|
|
552
541
|
*
|
|
542
|
+
* - annotations `Object[]` custom labels or shapes that can be tied to points, axis coordinates or chart pixel coordinates.
|
|
543
|
+
* Detailed API for annotations object is available in [API Site](http://api.highcharts.com/highcharts/annotations)
|
|
553
544
|
* - chart `Object` with options regarding the chart area and plot area as well as general chart options.
|
|
554
545
|
* Detailed API for chart object is available in [API Site](http://api.highcharts.com/highcharts/chart)
|
|
555
546
|
* - credits `Object` with options regarding the chart area and plot area as well as general chart options.
|
|
556
547
|
* Detailed API for credits object is available in [API Site](http://api.highcharts.com/highcharts/credits)
|
|
557
|
-
* - labels `Object[]` with HTML labels that can be positioned anywhere in the chart area
|
|
558
|
-
* Detailed API for labels object is available in [API Site](http://api.highcharts.com/highcharts/labels)
|
|
559
548
|
* - plotOptions `Object` wrapper for config objects for each series type.
|
|
560
549
|
* Detailed API for plotOptions object is available in [API Site](http://api.highcharts.com/highcharts/plotOptions)
|
|
561
550
|
* - series `Object[]` the actual series to append to the chart.
|
package/src/vaadin-chart.js
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
5
10
|
*/
|
|
6
11
|
import 'highcharts/es-modules/masters/highstock.src.js';
|
|
7
12
|
import 'highcharts/es-modules/masters/modules/accessibility.src.js';
|
|
13
|
+
import 'highcharts/es-modules/masters/modules/annotations.src.js';
|
|
8
14
|
import 'highcharts/es-modules/masters/highcharts-more.src.js';
|
|
9
15
|
import 'highcharts/es-modules/masters/highcharts-3d.src.js';
|
|
10
16
|
import 'highcharts/es-modules/masters/modules/data.src.js';
|
|
@@ -52,7 +58,7 @@ export function deepMerge(target, source) {
|
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
['exportChart', 'exportChartLocal', 'getSVG'].forEach((methodName) => {
|
|
55
|
-
/* eslint-disable no-invalid-this, prefer-arrow-callback */
|
|
61
|
+
/* eslint-disable @typescript-eslint/no-invalid-this, prefer-arrow-callback */
|
|
56
62
|
Highcharts.wrap(Highcharts.Chart.prototype, methodName, function (proceed, ...args) {
|
|
57
63
|
Highcharts.fireEvent(this, 'beforeExport');
|
|
58
64
|
const result = proceed.apply(this, args);
|
|
@@ -178,22 +184,6 @@ Highcharts.setOptions({ lang: { noData: '' } });
|
|
|
178
184
|
* 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).
|
|
179
185
|
* 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).
|
|
180
186
|
*
|
|
181
|
-
* Using as a base the project created with in Quick Start and an `additionalOptions` in order to make RTL adjustments:
|
|
182
|
-
*
|
|
183
|
-
* ```html
|
|
184
|
-
* <vaadin-chart title="۱- عنوان نمودار" subtitle="۲- عنوان فرعی نمودار"
|
|
185
|
-
* additional-options='{"title": {"useHTML": true}, "tooltip": {"useHTML": true}, "subtitle": {"useHTML": true},
|
|
186
|
-
* "legend": {"rtl": true}, "yAxis": [{"id": "۴- مقادیر", "title": {"text": "۴- مقادیر", "useHTML": true}}],
|
|
187
|
-
* "xAxis": {"reversed": true}}'>
|
|
188
|
-
* <vaadin-chart-series
|
|
189
|
-
* type= "column"
|
|
190
|
-
* title="۳- عنوان ردیف"
|
|
191
|
-
* unit="۴- مقادیر"
|
|
192
|
-
* values="[10,20,30]">
|
|
193
|
-
* </vaadin-chart-series>
|
|
194
|
-
* </vaadin-chart>
|
|
195
|
-
* ```
|
|
196
|
-
*
|
|
197
187
|
* ### Setting colors
|
|
198
188
|
*
|
|
199
189
|
* Although charts can be styled as described above, there is a simpler way for setting colors.
|
|
@@ -269,18 +259,6 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
269
259
|
return 'vaadin-chart';
|
|
270
260
|
}
|
|
271
261
|
|
|
272
|
-
/** @private */
|
|
273
|
-
static __callHighchartsFunction(functionName, redrawCharts, ...args) {
|
|
274
|
-
const functionToCall = Highcharts[functionName];
|
|
275
|
-
if (functionToCall && typeof functionToCall === 'function') {
|
|
276
|
-
args.forEach((arg) => inflateFunctions(arg));
|
|
277
|
-
functionToCall.apply(this.configuration, args);
|
|
278
|
-
if (redrawCharts) {
|
|
279
|
-
Highcharts.charts.forEach((c) => c.redraw());
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
|
|
284
262
|
static get properties() {
|
|
285
263
|
return {
|
|
286
264
|
/**
|
|
@@ -478,10 +456,23 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
478
456
|
];
|
|
479
457
|
}
|
|
480
458
|
|
|
459
|
+
/** @private */
|
|
460
|
+
static __callHighchartsFunction(functionName, redrawCharts, ...args) {
|
|
461
|
+
const functionToCall = Highcharts[functionName];
|
|
462
|
+
if (functionToCall && typeof functionToCall === 'function') {
|
|
463
|
+
args.forEach((arg) => inflateFunctions(arg));
|
|
464
|
+
functionToCall.apply(this.configuration, args);
|
|
465
|
+
if (redrawCharts) {
|
|
466
|
+
Highcharts.charts.forEach((c) => c.redraw());
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
|
|
481
471
|
constructor() {
|
|
482
472
|
super();
|
|
483
473
|
|
|
484
474
|
this._baseConfig = {
|
|
475
|
+
annotations: [],
|
|
485
476
|
chart: {
|
|
486
477
|
styledMode: true,
|
|
487
478
|
},
|
|
@@ -509,33 +500,6 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
509
500
|
};
|
|
510
501
|
}
|
|
511
502
|
|
|
512
|
-
/** @protected */
|
|
513
|
-
connectedCallback() {
|
|
514
|
-
super.connectedCallback();
|
|
515
|
-
this.__updateStyles();
|
|
516
|
-
beforeNextRender(this, () => {
|
|
517
|
-
// Detect if the chart had already been initialized. This might happen in
|
|
518
|
-
// environments where the chart is lazily attached (e.g Grid).
|
|
519
|
-
if (this.configuration) {
|
|
520
|
-
this.__reflow();
|
|
521
|
-
return;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
const options = { ...this.options, ...this._jsonConfigurationBuffer };
|
|
525
|
-
this._jsonConfigurationBuffer = null;
|
|
526
|
-
this.__initChart(options);
|
|
527
|
-
this.__addChildObserver();
|
|
528
|
-
this.__checkTurboMode();
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
/** @protected */
|
|
533
|
-
ready() {
|
|
534
|
-
super.ready();
|
|
535
|
-
|
|
536
|
-
this.addEventListener('chart-redraw', this.__onRedraw.bind(this));
|
|
537
|
-
}
|
|
538
|
-
|
|
539
503
|
/**
|
|
540
504
|
* @return {!Options}
|
|
541
505
|
*/
|
|
@@ -544,12 +508,10 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
544
508
|
deepMerge(options, this.additionalOptions);
|
|
545
509
|
|
|
546
510
|
if (this.type) {
|
|
547
|
-
options.chart = options.chart || {};
|
|
548
511
|
options.chart.type = this.type;
|
|
549
512
|
}
|
|
550
513
|
|
|
551
514
|
if (this.polar) {
|
|
552
|
-
options.chart = options.chart || {};
|
|
553
515
|
options.chart.polar = true;
|
|
554
516
|
}
|
|
555
517
|
|
|
@@ -574,7 +536,6 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
574
536
|
}
|
|
575
537
|
|
|
576
538
|
if (this.categories) {
|
|
577
|
-
options.xAxis = options.xAxis || {};
|
|
578
539
|
if (Array.isArray(options.xAxis)) {
|
|
579
540
|
// Set categories on first X axis
|
|
580
541
|
options.xAxis[0].categories = this.categories;
|
|
@@ -584,7 +545,6 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
584
545
|
}
|
|
585
546
|
|
|
586
547
|
if (isFinite(this.categoryMin)) {
|
|
587
|
-
options.xAxis = options.xAxis || {};
|
|
588
548
|
if (Array.isArray(options.xAxis)) {
|
|
589
549
|
// Set category-min on first X axis
|
|
590
550
|
options.xAxis[0].min = this.categoryMin;
|
|
@@ -594,7 +554,6 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
594
554
|
}
|
|
595
555
|
|
|
596
556
|
if (isFinite(this.categoryMax)) {
|
|
597
|
-
options.xAxis = options.xAxis || {};
|
|
598
557
|
if (Array.isArray(options.xAxis)) {
|
|
599
558
|
// Set category-max on first x axis
|
|
600
559
|
options.xAxis[0].max = this.categoryMax;
|
|
@@ -610,13 +569,13 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
610
569
|
}
|
|
611
570
|
|
|
612
571
|
if (this.emptyText) {
|
|
613
|
-
|
|
572
|
+
if (!options.lang) {
|
|
573
|
+
options.lang = {};
|
|
574
|
+
}
|
|
614
575
|
options.lang.noData = this.emptyText;
|
|
615
576
|
}
|
|
616
577
|
|
|
617
578
|
if (this.categoryPosition) {
|
|
618
|
-
options.chart = options.chart || {};
|
|
619
|
-
|
|
620
579
|
options.chart.inverted = this.__shouldInvert();
|
|
621
580
|
|
|
622
581
|
if (Array.isArray(options.xAxis)) {
|
|
@@ -629,14 +588,16 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
629
588
|
}
|
|
630
589
|
|
|
631
590
|
if (this.stacking) {
|
|
632
|
-
|
|
633
|
-
|
|
591
|
+
if (!options.plotOptions) {
|
|
592
|
+
options.plotOptions = {};
|
|
593
|
+
}
|
|
594
|
+
if (!options.plotOptions.series) {
|
|
595
|
+
options.plotOptions.series = {};
|
|
596
|
+
}
|
|
634
597
|
options.plotOptions.series.stacking = this.stacking;
|
|
635
598
|
}
|
|
636
599
|
|
|
637
600
|
if (this.chart3d) {
|
|
638
|
-
options.chart = options.chart || {};
|
|
639
|
-
|
|
640
601
|
options.chart.options3d = { ...this._baseChart3d, ...options.chart.options3d };
|
|
641
602
|
}
|
|
642
603
|
|
|
@@ -918,6 +879,33 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
918
879
|
};
|
|
919
880
|
}
|
|
920
881
|
|
|
882
|
+
/** @protected */
|
|
883
|
+
connectedCallback() {
|
|
884
|
+
super.connectedCallback();
|
|
885
|
+
this.__updateStyles();
|
|
886
|
+
beforeNextRender(this, () => {
|
|
887
|
+
// Detect if the chart had already been initialized. This might happen in
|
|
888
|
+
// environments where the chart is lazily attached (e.g Grid).
|
|
889
|
+
if (this.configuration) {
|
|
890
|
+
this.__reflow();
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
const options = { ...this.options, ...this._jsonConfigurationBuffer };
|
|
895
|
+
this._jsonConfigurationBuffer = null;
|
|
896
|
+
this.__initChart(options);
|
|
897
|
+
this.__addChildObserver();
|
|
898
|
+
this.__checkTurboMode();
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
/** @protected */
|
|
903
|
+
ready() {
|
|
904
|
+
super.ready();
|
|
905
|
+
|
|
906
|
+
this.addEventListener('chart-redraw', this.__onRedraw.bind(this));
|
|
907
|
+
}
|
|
908
|
+
|
|
921
909
|
/**
|
|
922
910
|
* Implements resize callback from `ResizeMixin`
|
|
923
911
|
* to reflow when the chart element is resized.
|
|
@@ -1118,12 +1106,12 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
1118
1106
|
*
|
|
1119
1107
|
* @param {!Options} jsonConfiguration Object chart configuration. Most important properties are:
|
|
1120
1108
|
*
|
|
1109
|
+
* - annotations `Object[]` custom labels or shapes that can be tied to points, axis coordinates or chart pixel coordinates.
|
|
1110
|
+
* Detailed API for annotations object is available in [API Site](http://api.highcharts.com/highcharts/annotations)
|
|
1121
1111
|
* - chart `Object` with options regarding the chart area and plot area as well as general chart options.
|
|
1122
1112
|
* Detailed API for chart object is available in [API Site](http://api.highcharts.com/highcharts/chart)
|
|
1123
1113
|
* - credits `Object` with options regarding the chart area and plot area as well as general chart options.
|
|
1124
1114
|
* Detailed API for credits object is available in [API Site](http://api.highcharts.com/highcharts/credits)
|
|
1125
|
-
* - labels `Object[]` with HTML labels that can be positioned anywhere in the chart area
|
|
1126
|
-
* Detailed API for labels object is available in [API Site](http://api.highcharts.com/highcharts/labels)
|
|
1127
1115
|
* - plotOptions `Object` wrapper for config objects for each series type.
|
|
1128
1116
|
* Detailed API for plotOptions object is available in [API Site](http://api.highcharts.com/highcharts/plotOptions)
|
|
1129
1117
|
* - series `Object[]` the actual series to append to the chart.
|
|
@@ -1310,13 +1298,12 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
1310
1298
|
if (!this.tempBodyStyle) {
|
|
1311
1299
|
let effectiveCss = '';
|
|
1312
1300
|
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
}
|
|
1301
|
+
[...this.shadowRoot.querySelectorAll('style')].forEach((style) => {
|
|
1302
|
+
effectiveCss += style.textContent;
|
|
1303
|
+
});
|
|
1317
1304
|
|
|
1318
1305
|
// Strip off host selectors that target individual instances
|
|
1319
|
-
effectiveCss = effectiveCss.replace(/:host\(.+?\)/
|
|
1306
|
+
effectiveCss = effectiveCss.replace(/:host\(.+?\)/gu, (match) => {
|
|
1320
1307
|
const selector = match.substr(6, match.length - 7);
|
|
1321
1308
|
return this.matches(selector) ? '' : match;
|
|
1322
1309
|
});
|
|
@@ -1367,7 +1354,9 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
|
|
|
1367
1354
|
|
|
1368
1355
|
path = path.split('.');
|
|
1369
1356
|
return path.reduce((obj, key) => {
|
|
1370
|
-
|
|
1357
|
+
if (!obj[key]) {
|
|
1358
|
+
obj[key] = {};
|
|
1359
|
+
}
|
|
1371
1360
|
return obj[key];
|
|
1372
1361
|
}, object);
|
|
1373
1362
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright (c)
|
|
4
|
-
*
|
|
3
|
+
* Copyright (c) 2000 - 2023 Vaadin Ltd.
|
|
4
|
+
*
|
|
5
|
+
* This program is available under Vaadin Commercial License and Service Terms.
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* See https://vaadin.com/commercial-license-and-service-terms for the full
|
|
9
|
+
* license.
|
|
5
10
|
*/
|
|
6
11
|
|
|
7
12
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-chart-series.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './src/vaadin-chart-series.js';
|