@vaadin/charts 24.0.0-alpha8 → 24.0.0-beta1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/charts",
3
- "version": "24.0.0-alpha8",
3
+ "version": "24.0.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,15 +36,15 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "24.0.0-alpha8",
40
- "@vaadin/vaadin-lumo-styles": "24.0.0-alpha8",
41
- "@vaadin/vaadin-material-styles": "24.0.0-alpha8",
42
- "@vaadin/vaadin-themable-mixin": "24.0.0-alpha8",
39
+ "@vaadin/component-base": "24.0.0-beta1",
40
+ "@vaadin/vaadin-lumo-styles": "24.0.0-beta1",
41
+ "@vaadin/vaadin-material-styles": "24.0.0-beta1",
42
+ "@vaadin/vaadin-themable-mixin": "24.0.0-beta1",
43
43
  "highcharts": "9.2.2"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@esm-bundle/chai": "^4.3.4",
47
- "@vaadin/testing-helpers": "^0.3.2",
47
+ "@vaadin/testing-helpers": "^0.4.0",
48
48
  "sinon": "^13.0.2"
49
49
  },
50
50
  "cvdlName": "vaadin-chart",
@@ -52,5 +52,5 @@
52
52
  "web-types.json",
53
53
  "web-types.lit.json"
54
54
  ],
55
- "gitHead": "476752249bb12295c500980d98a3256ad3b22b73"
55
+ "gitHead": "c5b48921a62482746df8e46994b37e1490fec27e"
56
56
  }
@@ -131,7 +131,7 @@ declare class ChartSeries extends HTMLElement {
131
131
  markers: ChartSeriesMarkers | null | undefined;
132
132
 
133
133
  /**
134
- * Used to connect the series to an axis; if multiple series have the same unit”, they will share axis.
134
+ * Used to connect the series to an axis; if multiple series have the same `unit`, they will share axis.
135
135
  * Displayed as a title for the axis.
136
136
  * If no unit is defined, then series will be connected to the first axis.
137
137
  */
@@ -61,55 +61,6 @@ class ChartSeries extends PolymerElement {
61
61
  return 'vaadin-chart-series';
62
62
  }
63
63
 
64
- get options() {
65
- const options = deepMerge({}, this.additionalOptions);
66
-
67
- if (this.type) {
68
- options.type = this.type;
69
- }
70
-
71
- if (this.title) {
72
- options.name = this.title;
73
- }
74
-
75
- if (this.values) {
76
- options.data = this.values;
77
- }
78
-
79
- if (this.markers) {
80
- if (!this.__isMarkersValid()) {
81
- this.markers = 'auto';
82
- }
83
- options.marker = this.__markersConfiguration;
84
- }
85
-
86
- if (this.unit) {
87
- options.yAxis = this.unit;
88
- }
89
-
90
- if (this.stack) {
91
- options.stack = this.stack;
92
- }
93
-
94
- if (isFinite(this.valueMin)) {
95
- options.yAxisValueMin = this.valueMin;
96
- }
97
-
98
- if (isFinite(this.valueMax)) {
99
- options.yAxisValueMax = this.valueMax;
100
- }
101
-
102
- if (this.neckWidth) {
103
- options.neckWidth = this.neckWidth;
104
- }
105
-
106
- if (this.neckPosition) {
107
- options.neckHeight = this.neckPosition;
108
- }
109
-
110
- return options;
111
- }
112
-
113
64
  static get properties() {
114
65
  return {
115
66
  /**
@@ -186,7 +137,7 @@ class ChartSeries extends PolymerElement {
186
137
  },
187
138
 
188
139
  /**
189
- * Used to connect the series to an axis; if multiple series have the same unit”, they will share axis.
140
+ * Used to connect the series to an axis; if multiple series have the same `unit`, they will share axis.
190
141
  * Displayed as a title for the axis.
191
142
  * If no unit is defined, then series will be connected to the first axis.
192
143
  */
@@ -274,6 +225,74 @@ class ChartSeries extends PolymerElement {
274
225
  ];
275
226
  }
276
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
+
277
296
  /**
278
297
  * Method to attach a series object of type `Highcharts.Series`.
279
298
  * @param {!Series} series Object of type `Highcharts.Series`
@@ -418,25 +437,6 @@ class ChartSeries extends PolymerElement {
418
437
  });
419
438
  }
420
439
 
421
- /** @private */
422
- get __markersConfiguration() {
423
- const config = {};
424
- switch (this.markers) {
425
- case 'shown':
426
- config.enabled = true;
427
- break;
428
- case 'hidden':
429
- config.enabled = false;
430
- break;
431
- case 'auto':
432
- default:
433
- config.enabled = null;
434
- break;
435
- }
436
-
437
- return config;
438
- }
439
-
440
440
  /** @private */
441
441
  __showWarn(propertyName, acceptedValues) {
442
442
  console.warn(`<vaadin-chart-series> Acceptable values for "${propertyName}" are ${acceptedValues}`);
@@ -364,22 +364,6 @@ export type ChartEventMap = ChartCustomEventMap & HTMLElementEventMap;
364
364
  * 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).
365
365
  * 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).
366
366
  *
367
- * Using as a base the project created with in Quick Start and an `additionalOptions` in order to make RTL adjustments:
368
- *
369
- * ```html
370
- * <vaadin-chart title="۱- عنوان نمودار" subtitle="۲- عنوان فرعی نمودار"
371
- * additional-options='{"title": {"useHTML": true}, "tooltip": {"useHTML": true}, "subtitle": {"useHTML": true},
372
- * "legend": {"rtl": true}, "yAxis": [{"id": "۴- مقادیر", "title": {"text": "۴- مقادیر", "useHTML": true}}],
373
- * "xAxis": {"reversed": true}}'>
374
- * <vaadin-chart-series
375
- * type= "column"
376
- * title="۳- عنوان ردیف"
377
- * unit="۴- مقادیر"
378
- * values="[10,20,30]">
379
- * </vaadin-chart-series>
380
- * </vaadin-chart>
381
- * ```
382
- *
383
367
  * ### Setting colors
384
368
  *
385
369
  * Although charts can be styled as described above, there is a simpler way for setting colors.
@@ -555,12 +539,12 @@ declare class Chart extends ResizeMixin(ThemableMixin(ElementMixin(HTMLElement))
555
539
  *
556
540
  * @param {!Options} jsonConfiguration Object chart configuration. Most important properties are:
557
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)
558
544
  * - chart `Object` with options regarding the chart area and plot area as well as general chart options.
559
545
  * Detailed API for chart object is available in [API Site](http://api.highcharts.com/highcharts/chart)
560
546
  * - credits `Object` with options regarding the chart area and plot area as well as general chart options.
561
547
  * Detailed API for credits object is available in [API Site](http://api.highcharts.com/highcharts/credits)
562
- * - labels `Object[]` with HTML labels that can be positioned anywhere in the chart area
563
- * Detailed API for labels object is available in [API Site](http://api.highcharts.com/highcharts/labels)
564
548
  * - plotOptions `Object` wrapper for config objects for each series type.
565
549
  * Detailed API for plotOptions object is available in [API Site](http://api.highcharts.com/highcharts/plotOptions)
566
550
  * - series `Object[]` the actual series to append to the chart.
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import 'highcharts/es-modules/masters/highstock.src.js';
12
12
  import 'highcharts/es-modules/masters/modules/accessibility.src.js';
13
+ import 'highcharts/es-modules/masters/modules/annotations.src.js';
13
14
  import 'highcharts/es-modules/masters/highcharts-more.src.js';
14
15
  import 'highcharts/es-modules/masters/highcharts-3d.src.js';
15
16
  import 'highcharts/es-modules/masters/modules/data.src.js';
@@ -57,7 +58,7 @@ export function deepMerge(target, source) {
57
58
  }
58
59
 
59
60
  ['exportChart', 'exportChartLocal', 'getSVG'].forEach((methodName) => {
60
- /* eslint-disable no-invalid-this, prefer-arrow-callback */
61
+ /* eslint-disable @typescript-eslint/no-invalid-this, prefer-arrow-callback */
61
62
  Highcharts.wrap(Highcharts.Chart.prototype, methodName, function (proceed, ...args) {
62
63
  Highcharts.fireEvent(this, 'beforeExport');
63
64
  const result = proceed.apply(this, args);
@@ -183,22 +184,6 @@ Highcharts.setOptions({ lang: { noData: '' } });
183
184
  * 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).
184
185
  * 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).
185
186
  *
186
- * Using as a base the project created with in Quick Start and an `additionalOptions` in order to make RTL adjustments:
187
- *
188
- * ```html
189
- * <vaadin-chart title="۱- عنوان نمودار" subtitle="۲- عنوان فرعی نمودار"
190
- * additional-options='{"title": {"useHTML": true}, "tooltip": {"useHTML": true}, "subtitle": {"useHTML": true},
191
- * "legend": {"rtl": true}, "yAxis": [{"id": "۴- مقادیر", "title": {"text": "۴- مقادیر", "useHTML": true}}],
192
- * "xAxis": {"reversed": true}}'>
193
- * <vaadin-chart-series
194
- * type= "column"
195
- * title="۳- عنوان ردیف"
196
- * unit="۴- مقادیر"
197
- * values="[10,20,30]">
198
- * </vaadin-chart-series>
199
- * </vaadin-chart>
200
- * ```
201
- *
202
187
  * ### Setting colors
203
188
  *
204
189
  * Although charts can be styled as described above, there is a simpler way for setting colors.
@@ -274,18 +259,6 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
274
259
  return 'vaadin-chart';
275
260
  }
276
261
 
277
- /** @private */
278
- static __callHighchartsFunction(functionName, redrawCharts, ...args) {
279
- const functionToCall = Highcharts[functionName];
280
- if (functionToCall && typeof functionToCall === 'function') {
281
- args.forEach((arg) => inflateFunctions(arg));
282
- functionToCall.apply(this.configuration, args);
283
- if (redrawCharts) {
284
- Highcharts.charts.forEach((c) => c.redraw());
285
- }
286
- }
287
- }
288
-
289
262
  static get properties() {
290
263
  return {
291
264
  /**
@@ -483,10 +456,23 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
483
456
  ];
484
457
  }
485
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
+
486
471
  constructor() {
487
472
  super();
488
473
 
489
474
  this._baseConfig = {
475
+ annotations: [],
490
476
  chart: {
491
477
  styledMode: true,
492
478
  },
@@ -514,33 +500,6 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
514
500
  };
515
501
  }
516
502
 
517
- /** @protected */
518
- connectedCallback() {
519
- super.connectedCallback();
520
- this.__updateStyles();
521
- beforeNextRender(this, () => {
522
- // Detect if the chart had already been initialized. This might happen in
523
- // environments where the chart is lazily attached (e.g Grid).
524
- if (this.configuration) {
525
- this.__reflow();
526
- return;
527
- }
528
-
529
- const options = { ...this.options, ...this._jsonConfigurationBuffer };
530
- this._jsonConfigurationBuffer = null;
531
- this.__initChart(options);
532
- this.__addChildObserver();
533
- this.__checkTurboMode();
534
- });
535
- }
536
-
537
- /** @protected */
538
- ready() {
539
- super.ready();
540
-
541
- this.addEventListener('chart-redraw', this.__onRedraw.bind(this));
542
- }
543
-
544
503
  /**
545
504
  * @return {!Options}
546
505
  */
@@ -920,6 +879,33 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
920
879
  };
921
880
  }
922
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
+
923
909
  /**
924
910
  * Implements resize callback from `ResizeMixin`
925
911
  * to reflow when the chart element is resized.
@@ -1120,12 +1106,12 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1120
1106
  *
1121
1107
  * @param {!Options} jsonConfiguration Object chart configuration. Most important properties are:
1122
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)
1123
1111
  * - chart `Object` with options regarding the chart area and plot area as well as general chart options.
1124
1112
  * Detailed API for chart object is available in [API Site](http://api.highcharts.com/highcharts/chart)
1125
1113
  * - credits `Object` with options regarding the chart area and plot area as well as general chart options.
1126
1114
  * Detailed API for credits object is available in [API Site](http://api.highcharts.com/highcharts/credits)
1127
- * - labels `Object[]` with HTML labels that can be positioned anywhere in the chart area
1128
- * Detailed API for labels object is available in [API Site](http://api.highcharts.com/highcharts/labels)
1129
1115
  * - plotOptions `Object` wrapper for config objects for each series type.
1130
1116
  * Detailed API for plotOptions object is available in [API Site](http://api.highcharts.com/highcharts/plotOptions)
1131
1117
  * - series `Object[]` the actual series to append to the chart.
@@ -1312,10 +1298,9 @@ class Chart extends ResizeMixin(ElementMixin(ThemableMixin(PolymerElement))) {
1312
1298
  if (!this.tempBodyStyle) {
1313
1299
  let effectiveCss = '';
1314
1300
 
1315
- const shadowStyles = this.shadowRoot.querySelectorAll('style');
1316
- for (let i = 0; i < shadowStyles.length; i++) {
1317
- effectiveCss += shadowStyles[i].textContent;
1318
- }
1301
+ [...this.shadowRoot.querySelectorAll('style')].forEach((style) => {
1302
+ effectiveCss += style.textContent;
1303
+ });
1319
1304
 
1320
1305
  // Strip off host selectors that target individual instances
1321
1306
  effectiveCss = effectiveCss.replace(/:host\(.+?\)/gu, (match) => {
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/charts",
4
- "version": "24.0.0-alpha8",
4
+ "version": "24.0.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-chart",
11
- "description": "`<vaadin-chart>` is a Web Component for creating high quality charts.\n\n### Basic use\n\nThere are two ways of configuring your `<vaadin-chart>` element: **HTML API**, **JS API** and **JSON API**.\nNote that you can make use of all APIs in your element.\n\n#### Configuring your chart using HTML API\n\n`vaadin-chart` has a set of attributes to make it easier for you to customize your chart.\n\n```html\n <vaadin-chart title=\"The chart title\" subtitle=\"The chart subtitle\">\n <vaadin-chart-series\n type=\"column\"\n title=\"The series title\"\n values=\"[10,20,30]\">\n </vaadin-chart-series>\n </vaadin-chart>\n```\n\n> Note that while you can set type for each series individually, for some types, such as `'bar'`, `'gauge'` and `'solidgauge'`, you\n> have to set it as the default series type on `<vaadin-chart>` in order to work properly.\n\n#### Configuring your chart using JS API\n\n1. Set an id for the `<vaadin-chart>` in the template\n```html\n <vaadin-chart id=\"mychart\"></vaadin-chart>\n```\n1. Add a function that uses `configuration` property (JS Api) to set chart title, categories and data\n```js\ninitChartWithJSApi() {\n requestAnimationFrame(() => {\n const configuration = this.$.mychart.configuration;\n configuration.setTitle({ text: 'The chart title' });\n // By default there is one X axis, it is referenced by configuration.xAxis[0].\n configuration.xAxis[0].setCategories(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);\n configuration.addSeries({\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n });\n });\n}\n```\n1. Call that function from connectedCallback (when the element is added to a document)\n```js\nconnectedCallback() {\n super.connectedCallback();\n this.initChartWithJSApi();\n}\n```\n\n#### Configuring your chart using JS JSON API\n\nJS JSON API is a simple alternative to the JS API.\n\n1. Set an id for the `<vaadin-chart>` in the template\n```html\n <vaadin-chart id=\"mychart\"></vaadin-chart>\n```\n1. Add a function that uses `updateConfiguration` method (JS JSON Api) to set chart title, categories and data\n```js\ninitChartWithJSJSONApi() {\n this.$.mychart.updateConfiguration({\n title: {\n text: 'The chart title'\n },\n subtitle: {\n text: 'Subtitle'\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n },\n series: [{\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n }]\n });\n}\n```\n1. Call that function from connectedCallback (when the element is added to a document)\n```js\nconnectedCallback() {\n super.connectedCallback();\n this.initChartWithJSJSONApi();\n}\n```\n\nIt should be noted that chart style customization cannot be done via the JS or JSON API.\nStyling properties in the JSON configuration will be ignored. The following section discusses chart styling.\n\n### CSS Styling\n\nChart appearance is primarily controlled by CSS style rules.\nA comprehensive list of the supported style classes can be found at\nhttps://www.highcharts.com/docs/chart-design-and-style/style-by-css\n\nSee also the [Chart Styling](https://vaadin.com/docs/latest/components/charts/css-styling) documentation.\n\n### RTL support\n\n`vaadin-charts` as well as [Highcharts](https://www.highcharts.com/) by itself are not adjusting the layout\nbased on the `dir` attribute. In order to make `vaadin-charts` display RTL content properly additional\nJSON configuration should be used.\nEach chart should be updated based on the specific needs, but general recommendations are:\n\n 1. Set `reversed` to true for xAxis (https://api.highcharts.com/highcharts/xAxis.reversed).\n 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).\n 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).\n\nUsing as a base the project created with in Quick Start and an `additionalOptions` in order to make RTL adjustments:\n\n```html\n <vaadin-chart title=\"۱- عنوان نمودار\" subtitle=\"۲- عنوان فرعی نمودار\"\n additional-options='{\"title\": {\"useHTML\": true}, \"tooltip\": {\"useHTML\": true}, \"subtitle\": {\"useHTML\": true},\n \"legend\": {\"rtl\": true}, \"yAxis\": [{\"id\": \"۴- مقادیر\", \"title\": {\"text\": \"۴- مقادیر\", \"useHTML\": true}}],\n \"xAxis\": {\"reversed\": true}}'>\n <vaadin-chart-series\n type= \"column\"\n title=\"۳- عنوان ردیف\"\n unit=\"۴- مقادیر\"\n values=\"[10,20,30]\">\n </vaadin-chart-series>\n </vaadin-chart>\n```\n\n### Setting colors\n\nAlthough charts can be styled as described above, there is a simpler way for setting colors.\nColors can be set using CSS custom properties `--vaadin-charts-color-{n}` (where `n` goes from `0 - 9`).\n\nFor example `--vaadin-charts-color-0` sets the color of the first series on a chart.\n\n### Validating your License\n\nWhen using Vaadin Charts in a development environment, you will see a pop-up that asks you\nto validate your license by signing in to vaadin.com.",
11
+ "description": "`<vaadin-chart>` is a Web Component for creating high quality charts.\n\n### Basic use\n\nThere are two ways of configuring your `<vaadin-chart>` element: **HTML API**, **JS API** and **JSON API**.\nNote that you can make use of all APIs in your element.\n\n#### Configuring your chart using HTML API\n\n`vaadin-chart` has a set of attributes to make it easier for you to customize your chart.\n\n```html\n <vaadin-chart title=\"The chart title\" subtitle=\"The chart subtitle\">\n <vaadin-chart-series\n type=\"column\"\n title=\"The series title\"\n values=\"[10,20,30]\">\n </vaadin-chart-series>\n </vaadin-chart>\n```\n\n> Note that while you can set type for each series individually, for some types, such as `'bar'`, `'gauge'` and `'solidgauge'`, you\n> have to set it as the default series type on `<vaadin-chart>` in order to work properly.\n\n#### Configuring your chart using JS API\n\n1. Set an id for the `<vaadin-chart>` in the template\n```html\n <vaadin-chart id=\"mychart\"></vaadin-chart>\n```\n1. Add a function that uses `configuration` property (JS Api) to set chart title, categories and data\n```js\ninitChartWithJSApi() {\n requestAnimationFrame(() => {\n const configuration = this.$.mychart.configuration;\n configuration.setTitle({ text: 'The chart title' });\n // By default there is one X axis, it is referenced by configuration.xAxis[0].\n configuration.xAxis[0].setCategories(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);\n configuration.addSeries({\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n });\n });\n}\n```\n1. Call that function from connectedCallback (when the element is added to a document)\n```js\nconnectedCallback() {\n super.connectedCallback();\n this.initChartWithJSApi();\n}\n```\n\n#### Configuring your chart using JS JSON API\n\nJS JSON API is a simple alternative to the JS API.\n\n1. Set an id for the `<vaadin-chart>` in the template\n```html\n <vaadin-chart id=\"mychart\"></vaadin-chart>\n```\n1. Add a function that uses `updateConfiguration` method (JS JSON Api) to set chart title, categories and data\n```js\ninitChartWithJSJSONApi() {\n this.$.mychart.updateConfiguration({\n title: {\n text: 'The chart title'\n },\n subtitle: {\n text: 'Subtitle'\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n },\n series: [{\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n }]\n });\n}\n```\n1. Call that function from connectedCallback (when the element is added to a document)\n```js\nconnectedCallback() {\n super.connectedCallback();\n this.initChartWithJSJSONApi();\n}\n```\n\nIt should be noted that chart style customization cannot be done via the JS or JSON API.\nStyling properties in the JSON configuration will be ignored. The following section discusses chart styling.\n\n### CSS Styling\n\nChart appearance is primarily controlled by CSS style rules.\nA comprehensive list of the supported style classes can be found at\nhttps://www.highcharts.com/docs/chart-design-and-style/style-by-css\n\nSee also the [Chart Styling](https://vaadin.com/docs/latest/components/charts/css-styling) documentation.\n\n### RTL support\n\n`vaadin-charts` as well as [Highcharts](https://www.highcharts.com/) by itself are not adjusting the layout\nbased on the `dir` attribute. In order to make `vaadin-charts` display RTL content properly additional\nJSON configuration should be used.\nEach chart should be updated based on the specific needs, but general recommendations are:\n\n 1. Set `reversed` to true for xAxis (https://api.highcharts.com/highcharts/xAxis.reversed).\n 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).\n 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).\n\n### Setting colors\n\nAlthough charts can be styled as described above, there is a simpler way for setting colors.\nColors can be set using CSS custom properties `--vaadin-charts-color-{n}` (where `n` goes from `0 - 9`).\n\nFor example `--vaadin-charts-color-0` sets the color of the first series on a chart.\n\n### Validating your License\n\nWhen using Vaadin Charts in a development environment, you will see a pop-up that asks you\nto validate your license by signing in to vaadin.com.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "category-max",
@@ -509,7 +509,7 @@
509
509
  },
510
510
  {
511
511
  "name": "unit",
512
- "description": "Used to connect the series to an axis; if multiple series have the same unit”, they will share axis.\nDisplayed as a title for the axis.\nIf no unit is defined, then series will be connected to the first axis.",
512
+ "description": "Used to connect the series to an axis; if multiple series have the same `unit`, they will share axis.\nDisplayed as a title for the axis.\nIf no unit is defined, then series will be connected to the first axis.",
513
513
  "value": {
514
514
  "type": [
515
515
  "string",
@@ -625,7 +625,7 @@
625
625
  },
626
626
  {
627
627
  "name": "unit",
628
- "description": "Used to connect the series to an axis; if multiple series have the same unit”, they will share axis.\nDisplayed as a title for the axis.\nIf no unit is defined, then series will be connected to the first axis.",
628
+ "description": "Used to connect the series to an axis; if multiple series have the same `unit`, they will share axis.\nDisplayed as a title for the axis.\nIf no unit is defined, then series will be connected to the first axis.",
629
629
  "value": {
630
630
  "type": [
631
631
  "string",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/charts",
4
- "version": "24.0.0-alpha8",
4
+ "version": "24.0.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-chart",
19
- "description": "`<vaadin-chart>` is a Web Component for creating high quality charts.\n\n### Basic use\n\nThere are two ways of configuring your `<vaadin-chart>` element: **HTML API**, **JS API** and **JSON API**.\nNote that you can make use of all APIs in your element.\n\n#### Configuring your chart using HTML API\n\n`vaadin-chart` has a set of attributes to make it easier for you to customize your chart.\n\n```html\n <vaadin-chart title=\"The chart title\" subtitle=\"The chart subtitle\">\n <vaadin-chart-series\n type=\"column\"\n title=\"The series title\"\n values=\"[10,20,30]\">\n </vaadin-chart-series>\n </vaadin-chart>\n```\n\n> Note that while you can set type for each series individually, for some types, such as `'bar'`, `'gauge'` and `'solidgauge'`, you\n> have to set it as the default series type on `<vaadin-chart>` in order to work properly.\n\n#### Configuring your chart using JS API\n\n1. Set an id for the `<vaadin-chart>` in the template\n```html\n <vaadin-chart id=\"mychart\"></vaadin-chart>\n```\n1. Add a function that uses `configuration` property (JS Api) to set chart title, categories and data\n```js\ninitChartWithJSApi() {\n requestAnimationFrame(() => {\n const configuration = this.$.mychart.configuration;\n configuration.setTitle({ text: 'The chart title' });\n // By default there is one X axis, it is referenced by configuration.xAxis[0].\n configuration.xAxis[0].setCategories(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);\n configuration.addSeries({\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n });\n });\n}\n```\n1. Call that function from connectedCallback (when the element is added to a document)\n```js\nconnectedCallback() {\n super.connectedCallback();\n this.initChartWithJSApi();\n}\n```\n\n#### Configuring your chart using JS JSON API\n\nJS JSON API is a simple alternative to the JS API.\n\n1. Set an id for the `<vaadin-chart>` in the template\n```html\n <vaadin-chart id=\"mychart\"></vaadin-chart>\n```\n1. Add a function that uses `updateConfiguration` method (JS JSON Api) to set chart title, categories and data\n```js\ninitChartWithJSJSONApi() {\n this.$.mychart.updateConfiguration({\n title: {\n text: 'The chart title'\n },\n subtitle: {\n text: 'Subtitle'\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n },\n series: [{\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n }]\n });\n}\n```\n1. Call that function from connectedCallback (when the element is added to a document)\n```js\nconnectedCallback() {\n super.connectedCallback();\n this.initChartWithJSJSONApi();\n}\n```\n\nIt should be noted that chart style customization cannot be done via the JS or JSON API.\nStyling properties in the JSON configuration will be ignored. The following section discusses chart styling.\n\n### CSS Styling\n\nChart appearance is primarily controlled by CSS style rules.\nA comprehensive list of the supported style classes can be found at\nhttps://www.highcharts.com/docs/chart-design-and-style/style-by-css\n\nSee also the [Chart Styling](https://vaadin.com/docs/latest/components/charts/css-styling) documentation.\n\n### RTL support\n\n`vaadin-charts` as well as [Highcharts](https://www.highcharts.com/) by itself are not adjusting the layout\nbased on the `dir` attribute. In order to make `vaadin-charts` display RTL content properly additional\nJSON configuration should be used.\nEach chart should be updated based on the specific needs, but general recommendations are:\n\n 1. Set `reversed` to true for xAxis (https://api.highcharts.com/highcharts/xAxis.reversed).\n 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).\n 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).\n\nUsing as a base the project created with in Quick Start and an `additionalOptions` in order to make RTL adjustments:\n\n```html\n <vaadin-chart title=\"۱- عنوان نمودار\" subtitle=\"۲- عنوان فرعی نمودار\"\n additional-options='{\"title\": {\"useHTML\": true}, \"tooltip\": {\"useHTML\": true}, \"subtitle\": {\"useHTML\": true},\n \"legend\": {\"rtl\": true}, \"yAxis\": [{\"id\": \"۴- مقادیر\", \"title\": {\"text\": \"۴- مقادیر\", \"useHTML\": true}}],\n \"xAxis\": {\"reversed\": true}}'>\n <vaadin-chart-series\n type= \"column\"\n title=\"۳- عنوان ردیف\"\n unit=\"۴- مقادیر\"\n values=\"[10,20,30]\">\n </vaadin-chart-series>\n </vaadin-chart>\n```\n\n### Setting colors\n\nAlthough charts can be styled as described above, there is a simpler way for setting colors.\nColors can be set using CSS custom properties `--vaadin-charts-color-{n}` (where `n` goes from `0 - 9`).\n\nFor example `--vaadin-charts-color-0` sets the color of the first series on a chart.\n\n### Validating your License\n\nWhen using Vaadin Charts in a development environment, you will see a pop-up that asks you\nto validate your license by signing in to vaadin.com.",
19
+ "description": "`<vaadin-chart>` is a Web Component for creating high quality charts.\n\n### Basic use\n\nThere are two ways of configuring your `<vaadin-chart>` element: **HTML API**, **JS API** and **JSON API**.\nNote that you can make use of all APIs in your element.\n\n#### Configuring your chart using HTML API\n\n`vaadin-chart` has a set of attributes to make it easier for you to customize your chart.\n\n```html\n <vaadin-chart title=\"The chart title\" subtitle=\"The chart subtitle\">\n <vaadin-chart-series\n type=\"column\"\n title=\"The series title\"\n values=\"[10,20,30]\">\n </vaadin-chart-series>\n </vaadin-chart>\n```\n\n> Note that while you can set type for each series individually, for some types, such as `'bar'`, `'gauge'` and `'solidgauge'`, you\n> have to set it as the default series type on `<vaadin-chart>` in order to work properly.\n\n#### Configuring your chart using JS API\n\n1. Set an id for the `<vaadin-chart>` in the template\n```html\n <vaadin-chart id=\"mychart\"></vaadin-chart>\n```\n1. Add a function that uses `configuration` property (JS Api) to set chart title, categories and data\n```js\ninitChartWithJSApi() {\n requestAnimationFrame(() => {\n const configuration = this.$.mychart.configuration;\n configuration.setTitle({ text: 'The chart title' });\n // By default there is one X axis, it is referenced by configuration.xAxis[0].\n configuration.xAxis[0].setCategories(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']);\n configuration.addSeries({\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n });\n });\n}\n```\n1. Call that function from connectedCallback (when the element is added to a document)\n```js\nconnectedCallback() {\n super.connectedCallback();\n this.initChartWithJSApi();\n}\n```\n\n#### Configuring your chart using JS JSON API\n\nJS JSON API is a simple alternative to the JS API.\n\n1. Set an id for the `<vaadin-chart>` in the template\n```html\n <vaadin-chart id=\"mychart\"></vaadin-chart>\n```\n1. Add a function that uses `updateConfiguration` method (JS JSON Api) to set chart title, categories and data\n```js\ninitChartWithJSJSONApi() {\n this.$.mychart.updateConfiguration({\n title: {\n text: 'The chart title'\n },\n subtitle: {\n text: 'Subtitle'\n },\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n },\n series: [{\n type: 'column',\n data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]\n }]\n });\n}\n```\n1. Call that function from connectedCallback (when the element is added to a document)\n```js\nconnectedCallback() {\n super.connectedCallback();\n this.initChartWithJSJSONApi();\n}\n```\n\nIt should be noted that chart style customization cannot be done via the JS or JSON API.\nStyling properties in the JSON configuration will be ignored. The following section discusses chart styling.\n\n### CSS Styling\n\nChart appearance is primarily controlled by CSS style rules.\nA comprehensive list of the supported style classes can be found at\nhttps://www.highcharts.com/docs/chart-design-and-style/style-by-css\n\nSee also the [Chart Styling](https://vaadin.com/docs/latest/components/charts/css-styling) documentation.\n\n### RTL support\n\n`vaadin-charts` as well as [Highcharts](https://www.highcharts.com/) by itself are not adjusting the layout\nbased on the `dir` attribute. In order to make `vaadin-charts` display RTL content properly additional\nJSON configuration should be used.\nEach chart should be updated based on the specific needs, but general recommendations are:\n\n 1. Set `reversed` to true for xAxis (https://api.highcharts.com/highcharts/xAxis.reversed).\n 2. Set `useHTML` to true for text elements, i.e. `tooltip` (https://api.highcharts.com/highcharts/tooltip.useHTML).\n 3. Set `rtl` to true for `legend` (https://api.highcharts.com/highcharts/legend.rtl).\n\n### Setting colors\n\nAlthough charts can be styled as described above, there is a simpler way for setting colors.\nColors can be set using CSS custom properties `--vaadin-charts-color-{n}` (where `n` goes from `0 - 9`).\n\nFor example `--vaadin-charts-color-0` sets the color of the first series on a chart.\n\n### Validating your License\n\nWhen using Vaadin Charts in a development environment, you will see a pop-up that asks you\nto validate your license by signing in to vaadin.com.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -392,7 +392,7 @@
392
392
  },
393
393
  {
394
394
  "name": ".unit",
395
- "description": "Used to connect the series to an axis; if multiple series have the same unit”, they will share axis.\nDisplayed as a title for the axis.\nIf no unit is defined, then series will be connected to the first axis.",
395
+ "description": "Used to connect the series to an axis; if multiple series have the same `unit`, they will share axis.\nDisplayed as a title for the axis.\nIf no unit is defined, then series will be connected to the first axis.",
396
396
  "value": {
397
397
  "kind": "expression"
398
398
  }