@vaadin/charts 25.3.0-beta1 → 25.3.0-beta2

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": "25.3.0-beta1",
3
+ "version": "25.3.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,17 +35,17 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/component-base": "25.3.0-beta1",
39
- "@vaadin/vaadin-themable-mixin": "25.3.0-beta1",
38
+ "@vaadin/component-base": "25.3.0-beta2",
39
+ "@vaadin/vaadin-themable-mixin": "25.3.0-beta2",
40
40
  "highcharts": "12.2.0",
41
41
  "lit": "^3.0.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@vaadin/aura": "25.3.0-beta1",
45
- "@vaadin/chai-plugins": "25.3.0-beta1",
46
- "@vaadin/test-runner-commands": "25.3.0-beta1",
44
+ "@vaadin/aura": "25.3.0-beta2",
45
+ "@vaadin/chai-plugins": "25.3.0-beta2",
46
+ "@vaadin/test-runner-commands": "25.3.0-beta2",
47
47
  "@vaadin/testing-helpers": "^2.0.0",
48
- "@vaadin/vaadin-lumo-styles": "25.3.0-beta1",
48
+ "@vaadin/vaadin-lumo-styles": "25.3.0-beta2",
49
49
  "sinon": "^22.0.0"
50
50
  },
51
51
  "cvdlName": "vaadin-chart",
@@ -54,5 +54,5 @@
54
54
  "web-types.json",
55
55
  "web-types.lit.json"
56
56
  ],
57
- "gitHead": "295432e44a6967e1aff36462b2e3e1d0e64eb8cc"
57
+ "gitHead": "d97ccbec217b60c39f3c8b2dd52473c79a48c8c1"
58
58
  }
@@ -21,9 +21,32 @@ import '@vaadin/component-base/src/styles/user-colors.js';
21
21
  import { css, unsafeCSS } from 'lit';
22
22
  import { addGlobalStyles } from '@vaadin/component-base/src/css-utils.js';
23
23
 
24
- /* Tooltip styles, to support `"tooltip": { "outside": true }` config option */
24
+ const seriesColorTokens = Array.from(
25
+ { length: 10 },
26
+ (_, i) =>
27
+ `--_color-${i}: var(--highcharts-color-${i}, var(--vaadin-charts-color-${i}, var(--vaadin-user-color-${i})));`,
28
+ ).join('\n ');
29
+
30
+ // A non-split tooltip carries highcharts-color-N on the tooltip element itself,
31
+ // a split one on its child boxes, so both selectors are needed.
32
+ const seriesColorRules = Array.from(
33
+ { length: 10 },
34
+ (_, i) =>
35
+ `.highcharts-tooltip-container .highcharts-tooltip.highcharts-color-${i},
36
+ .highcharts-tooltip-container .highcharts-tooltip .highcharts-color-${i} { fill: var(--_color-${i}); stroke: var(--_color-${i}); }`,
37
+ ).join('\n');
38
+
39
+ /* Emitted at both scopes, so it looks absent from upstream Highcharts. Do not prune. */
25
40
  // postcss-lit-disable-next-line
26
41
  const tooltipStyles = (scope) => css`
42
+ ${unsafeCSS(scope)} .highcharts-strong {
43
+ font-weight: bold;
44
+ }
45
+
46
+ ${unsafeCSS(scope)} .highcharts-emphasized {
47
+ font-style: italic;
48
+ }
49
+
27
50
  ${unsafeCSS(scope)} .highcharts-tooltip {
28
51
  cursor: default;
29
52
  pointer-events: none;
@@ -35,6 +58,8 @@ const tooltipStyles = (scope) => css`
35
58
  ${unsafeCSS(scope)} .highcharts-tooltip text,
36
59
  ${unsafeCSS(scope)} .highcharts-tooltip foreignObject span {
37
60
  fill: var(--highcharts-neutral-color-80, var(--vaadin-charts-data-label, var(--vaadin-text-color)));
61
+ /* The tooltip carries the series color, and stroke inherits into the glyphs. */
62
+ stroke-width: 0;
38
63
  }
39
64
 
40
65
  ${unsafeCSS(scope)} .highcharts-tooltip .highcharts-tracker {
@@ -65,6 +90,12 @@ const tooltipStyles = (scope) => css`
65
90
  addGlobalStyles(
66
91
  'vaadin-charts-tooltip',
67
92
  css`
93
+ .highcharts-tooltip-container {
94
+ ${unsafeCSS(seriesColorTokens)}
95
+ }
96
+
97
+ ${unsafeCSS(seriesColorRules)}
98
+
68
99
  .highcharts-tooltip-container .highcharts-root {
69
100
  overflow: visible;
70
101
  font-size: var(--vaadin-charts-font-size, 0.75rem);
@@ -87,20 +118,13 @@ export const chartStyles = css`
87
118
  font-size: var(--vaadin-charts-font-size, 0.75rem);
88
119
  line-height: normal;
89
120
 
90
- /* Needs to be a color, not a background image */
121
+ /* Needs to be a color, not a background image. A theme may set it to transparent. */
91
122
  --_bg: var(--vaadin-charts-background, var(--vaadin-background-color));
123
+ /* What elements drawn on the canvas read against. A transparent canvas has to
124
+ declare what shows through instead. */
125
+ --_surface: var(--vaadin-charts-surface, var(--_bg));
92
126
 
93
- --_color-0: var(--highcharts-color-0, var(--vaadin-charts-color-0, var(--vaadin-user-color-0)));
94
- --_color-1: var(--highcharts-color-1, var(--vaadin-charts-color-1, var(--vaadin-user-color-1)));
95
- --_color-2: var(--highcharts-color-2, var(--vaadin-charts-color-2, var(--vaadin-user-color-2)));
96
- --_color-3: var(--highcharts-color-3, var(--vaadin-charts-color-3, var(--vaadin-user-color-3)));
97
- --_color-4: var(--highcharts-color-4, var(--vaadin-charts-color-4, var(--vaadin-user-color-4)));
98
- --_color-5: var(--highcharts-color-5, var(--vaadin-charts-color-5, var(--vaadin-user-color-5)));
99
- --_color-6: var(--highcharts-color-6, var(--vaadin-charts-color-6, var(--vaadin-user-color-6)));
100
- --_color-7: var(--highcharts-color-7, var(--vaadin-charts-color-7, var(--vaadin-user-color-7)));
101
- --_color-8: var(--highcharts-color-8, var(--vaadin-charts-color-8, var(--vaadin-user-color-8)));
102
- --_color-9: var(--highcharts-color-9, var(--vaadin-charts-color-9, var(--vaadin-user-color-9)));
103
-
127
+ ${unsafeCSS(seriesColorTokens)}
104
128
  --_color-0-label: oklch(from var(--_color-0) clamp(0, (0.62 - l) * 1000, 1) 0 0);
105
129
  --_color-1-label: oklch(from var(--_color-1) clamp(0, (0.62 - l) * 1000, 1) 0 0);
106
130
  --_color-2-label: oklch(from var(--_color-2) clamp(0, (0.62 - l) * 1000, 1) 0 0);
@@ -118,7 +142,7 @@ export const chartStyles = css`
118
142
  --_label: var(--vaadin-charts-label, var(--vaadin-text-color));
119
143
  --_secondary-label: var(--vaadin-charts-secondary-label, var(--vaadin-text-color-secondary));
120
144
  --_disabled-label: var(--vaadin-charts-disabled-label, var(--vaadin-text-color-disabled));
121
- --_point-border: var(--vaadin-charts-point-border, var(--_bg));
145
+ --_point-border: var(--vaadin-charts-point-border, var(--_surface));
122
146
  --_axis-line: var(--vaadin-charts-axis-line, var(--vaadin-border-color-secondary));
123
147
  --_axis-title: var(--vaadin-charts-axis-title, var(--_secondary-label));
124
148
  --_axis-label: var(--vaadin-charts-axis-label, var(--_secondary-label));
@@ -168,14 +192,6 @@ export const chartStyles = css`
168
192
  stroke-width: 0;
169
193
  }
170
194
 
171
- :where([styled-mode]) .highcharts-strong {
172
- font-weight: bold;
173
- }
174
-
175
- :where([styled-mode]) .highcharts-emphasized {
176
- font-style: italic;
177
- }
178
-
179
195
  :where([styled-mode]) .highcharts-anchor {
180
196
  cursor: pointer;
181
197
  }
@@ -478,7 +494,7 @@ export const chartStyles = css`
478
494
 
479
495
  :where([styled-mode]) .highcharts-markers {
480
496
  stroke-width: 1px;
481
- stroke: var(--highcharts-background-color, var(--_bg));
497
+ stroke: var(--highcharts-background-color, var(--_surface));
482
498
  }
483
499
 
484
500
  :where([styled-mode])
@@ -717,7 +733,7 @@ export const chartStyles = css`
717
733
  /* Loading */
718
734
  :where([styled-mode]) .highcharts-loading {
719
735
  position: absolute;
720
- background-color: var(--highcharts-background-color, var(--_bg));
736
+ background-color: var(--highcharts-background-color, var(--_surface));
721
737
  opacity: 0.5;
722
738
  text-align: center;
723
739
  z-index: 10;
@@ -761,7 +777,7 @@ export const chartStyles = css`
761
777
 
762
778
  /* Highcharts More and modules */
763
779
  :where([styled-mode]) .highcharts-boxplot-box {
764
- fill: var(--highcharts-background-color, var(--_bg));
780
+ fill: var(--highcharts-background-color, var(--_surface));
765
781
  }
766
782
 
767
783
  :where([styled-mode]) .highcharts-boxplot-median {
@@ -856,7 +872,7 @@ export const chartStyles = css`
856
872
 
857
873
  :where([styled-mode]) .highcharts-navigator-handle {
858
874
  stroke: var(--highcharts-neutral-color-40, var(--_grid-line));
859
- fill: var(--highcharts-neutral-color-5, var(--_bg));
875
+ fill: var(--highcharts-neutral-color-5, var(--_surface));
860
876
  cursor: ew-resize;
861
877
  }
862
878
 
@@ -900,7 +916,7 @@ export const chartStyles = css`
900
916
  }
901
917
 
902
918
  :where([styled-mode]) .highcharts-scrollbar-button {
903
- fill: var(--highcharts-neutral-color-10, var(--_bg));
919
+ fill: var(--highcharts-neutral-color-10, var(--_surface));
904
920
  stroke: var(--highcharts-neutral-color-20);
905
921
  stroke-width: 1px;
906
922
  }
@@ -946,6 +962,7 @@ export const chartStyles = css`
946
962
  fill: var(--highcharts-neutral-color-80, var(--vaadin-charts-button-label, var(--_label)));
947
963
  }
948
964
 
965
+ /* Inverts like vaadin-button[theme~='primary']. Lumo and Aura override both. */
949
966
  :where([styled-mode]) .highcharts-button-pressed {
950
967
  font-weight: bold;
951
968
  fill: var(--highcharts-highlight-color-10, var(--vaadin-charts-button-active-background, var(--_label)));
@@ -953,7 +970,7 @@ export const chartStyles = css`
953
970
  }
954
971
 
955
972
  :where([styled-mode]) .highcharts-button-pressed text {
956
- fill: var(--highcharts-neutral-color-80, var(--vaadin-charts-button-active-label, var(--_bg)));
973
+ fill: var(--highcharts-neutral-color-80, var(--vaadin-charts-button-active-label, var(--_surface)));
957
974
  font-weight: bold;
958
975
  }
959
976
 
@@ -1006,7 +1023,7 @@ export const chartStyles = css`
1006
1023
  }
1007
1024
 
1008
1025
  :where([styled-mode]) .highcharts-crosshair-label text {
1009
- fill: var(--highcharts-background-color, var(--_bg));
1026
+ fill: var(--highcharts-background-color, var(--_surface));
1010
1027
  font-size: 0.9em;
1011
1028
  }
1012
1029
 
@@ -1046,7 +1063,7 @@ export const chartStyles = css`
1046
1063
 
1047
1064
  :where([styled-mode]) .highcharts-flags-series .highcharts-point .highcharts-label-box {
1048
1065
  stroke: var(--highcharts-neutral-color-40, var(--_grid-line));
1049
- fill: var(--highcharts-background-color, var(--_bg));
1066
+ fill: var(--highcharts-background-color, var(--_surface));
1050
1067
  transition: fill 250ms;
1051
1068
  }
1052
1069
 
@@ -1055,7 +1072,7 @@ export const chartStyles = css`
1055
1072
  --highcharts-neutral-color-100,
1056
1073
  color-mix(in srgb, var(--vaadin-charts-contrast, var(--_label)) 60%, transparent)
1057
1074
  );
1058
- fill: var(--highcharts-highlight-color-20, var(--_bg));
1075
+ fill: var(--highcharts-highlight-color-20, var(--_surface));
1059
1076
  }
1060
1077
 
1061
1078
  :where([styled-mode]) .highcharts-flags-series .highcharts-point text {
@@ -1134,7 +1151,7 @@ export const chartStyles = css`
1134
1151
  /* Exporting module */
1135
1152
  :where([styled-mode]) .highcharts-contextbutton {
1136
1153
  /* Fill is needed to capture hover */
1137
- fill: var(--highcharts-background-color, var(--_bg));
1154
+ fill: var(--highcharts-background-color, var(--_surface));
1138
1155
  stroke: none;
1139
1156
  stroke-linecap: round;
1140
1157
  }
@@ -1151,7 +1168,7 @@ export const chartStyles = css`
1151
1168
 
1152
1169
  :where([styled-mode]) .highcharts-menu {
1153
1170
  border: none;
1154
- background: var(--highcharts-background-color, var(--_bg));
1171
+ background: var(--highcharts-background-color, var(--_surface));
1155
1172
  border-radius: 3px;
1156
1173
  padding: 0.5em;
1157
1174
  box-shadow: 3px 3px 10px #888;
@@ -1171,7 +1188,7 @@ export const chartStyles = css`
1171
1188
  }
1172
1189
 
1173
1190
  :where([styled-mode]) .highcharts-menu-item:hover {
1174
- background: var(--highcharts-neutral-color-5, var(--_bg));
1191
+ background: var(--highcharts-neutral-color-5, var(--_surface));
1175
1192
  }
1176
1193
 
1177
1194
  /* Breadcrumbs */
@@ -724,7 +724,34 @@ export const ChartMixin = (superClass) =>
724
724
  this.configuration = Highcharts.chart(this.$.chart, options);
725
725
  }
726
726
 
727
- this.__forceResize();
727
+ this.__syncOutsideTooltipColors();
728
+ this.__redrawOrganizationDataLabels();
729
+ }
730
+
731
+ /**
732
+ * A `tooltip: { outside: true }` tooltip renders in `document.body`, so it
733
+ * inherits neither the palette a theme scopes to `vaadin-chart` nor any
734
+ * `--vaadin-charts-color-*` set on this element. Copy the resolved series
735
+ * colours onto its container instead.
736
+ *
737
+ * @private
738
+ */
739
+ __syncOutsideTooltipColors() {
740
+ const { tooltip } = this.configuration;
741
+ if (!tooltip || !tooltip.outside) {
742
+ return;
743
+ }
744
+
745
+ Highcharts.addEvent(tooltip, 'refresh', () => {
746
+ const { container } = tooltip;
747
+ if (!container) {
748
+ return;
749
+ }
750
+ const style = getComputedStyle(this);
751
+ for (let i = 0; i < 10; i++) {
752
+ container.style.setProperty(`--_color-${i}`, style.getPropertyValue(`--_color-${i}`));
753
+ }
754
+ });
728
755
  }
729
756
 
730
757
  /** @protected */
@@ -1480,24 +1507,26 @@ export const ChartMixin = (superClass) =>
1480
1507
  /**
1481
1508
  * @private
1482
1509
  * Workaround for https://github.com/highcharts/highcharts/issues/23443
1483
- * Forces a resize in the chart to make it calculate the labels positions
1484
- * correctly in a chart with "organization" series
1510
+ * In styled mode the label CSS is not applied yet when "organization" data
1511
+ * labels are first measured, so they need a second measurement pass.
1485
1512
  *
1486
1513
  * TODO: Remove when the related ticket is fixed
1487
1514
  */
1488
- __forceResize() {
1489
- const chart = this.configuration;
1490
- const { options } = chart;
1491
- const hasOrganizationSeries =
1492
- options.chart.styledMode &&
1493
- (options.chart.type === 'organization' || options.series.some((series) => series.type === 'organization'));
1494
- if (!hasOrganizationSeries) {
1515
+ __redrawOrganizationDataLabels() {
1516
+ if (!this.configuration.options.chart.styledMode) {
1495
1517
  return;
1496
1518
  }
1497
1519
 
1520
+ // Series declared as <vaadin-chart-series> children are not on the chart yet,
1521
+ // so the organization check waits for the frame too. Reading the chart there
1522
+ // rather than capturing it also keeps a pending frame from holding a
1523
+ // destroyed chart alive.
1498
1524
  requestAnimationFrame(() => {
1499
- chart.setSize(chart.chartWidth - 10, chart.chartHeight);
1500
- chart.setSize(null, null);
1525
+ this.configuration?.series.forEach((series) => {
1526
+ if (series.type === 'organization') {
1527
+ series.drawDataLabels?.();
1528
+ }
1529
+ });
1501
1530
  });
1502
1531
  }
1503
1532
 
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/charts",
4
- "version": "25.3.0-beta1",
4
+ "version": "25.3.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -206,7 +206,7 @@
206
206
  },
207
207
  {
208
208
  "name": "vaadin-chart",
209
- "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#### 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#### Using JS API\n\nUse [`configuration`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-chart#property-configuration) property to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\n\n// Wait for default configuration to be ready\nrequestAnimationFrame(() => {\n const configuration = chart.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\n#### Using JS JSON API\n\nUse [`updateConfiguration`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-chart#method-updateConfiguration) method to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\nchart.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\n**Note:** 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.",
209
+ "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#### 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#### Using JS API\n\nUse [`configuration`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta2/#/elements/vaadin-chart#property-configuration) property to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\n\n// Wait for default configuration to be ready\nrequestAnimationFrame(() => {\n const configuration = chart.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\n#### Using JS JSON API\n\nUse [`updateConfiguration`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta2/#/elements/vaadin-chart#method-updateConfiguration) method to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\nchart.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\n**Note:** 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.",
210
210
  "attributes": [
211
211
  {
212
212
  "name": "category-max",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/charts",
4
- "version": "25.3.0-beta1",
4
+ "version": "25.3.0-beta2",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -100,7 +100,7 @@
100
100
  },
101
101
  {
102
102
  "name": "vaadin-chart",
103
- "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#### 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#### Using JS API\n\nUse [`configuration`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-chart#property-configuration) property to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\n\n// Wait for default configuration to be ready\nrequestAnimationFrame(() => {\n const configuration = chart.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\n#### Using JS JSON API\n\nUse [`updateConfiguration`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta1/#/elements/vaadin-chart#method-updateConfiguration) method to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\nchart.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\n**Note:** 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.",
103
+ "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#### 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#### Using JS API\n\nUse [`configuration`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta2/#/elements/vaadin-chart#property-configuration) property to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\n\n// Wait for default configuration to be ready\nrequestAnimationFrame(() => {\n const configuration = chart.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\n#### Using JS JSON API\n\nUse [`updateConfiguration`](https://cdn.vaadin.com/vaadin-web-components/25.3.0-beta2/#/elements/vaadin-chart#method-updateConfiguration) method to set chart title, categories and data:\n\n```js\nconst chart = document.querySelector('vaadin-chart');\nchart.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\n**Note:** 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.",
104
104
  "extension": true,
105
105
  "attributes": [
106
106
  {