@synergy-design-system/metadata 3.16.0 → 3.17.0

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/data/core/asset/asset:sick2018-icons.json +1 -1
  3. package/data/core/asset/asset:sick2018-logos.json +1 -1
  4. package/data/core/asset/asset:sick2018-system-icons.json +1 -1
  5. package/data/core/asset/asset:sick2025-icons-fill.json +1 -1
  6. package/data/core/asset/asset:sick2025-icons-outline.json +1 -1
  7. package/data/core/asset/asset:sick2025-logos.json +1 -1
  8. package/data/core/asset/asset:sick2025-system-icons.json +1 -1
  9. package/data/core/component/component:syn-chart.json +2 -2
  10. package/data/core/setup/setup:angular-components-module.json +1 -1
  11. package/data/core/setup/setup:angular-forms-module.json +1 -1
  12. package/data/core/setup/setup:angular-package.json +2 -2
  13. package/data/core/setup/setup:angular-validators-module.json +1 -1
  14. package/data/core/setup/setup:assets-package.json +2 -2
  15. package/data/core/setup/setup:components-package.json +2 -2
  16. package/data/core/setup/setup:fonts-package.json +2 -2
  17. package/data/core/setup/setup:react-package.json +2 -2
  18. package/data/core/setup/setup:styles-package.json +2 -2
  19. package/data/core/setup/setup:tokens-package.json +2 -2
  20. package/data/core/setup/setup:vue-package.json +2 -2
  21. package/data/core/style/style:syn-body.json +1 -1
  22. package/data/core/style/style:syn-heading.json +1 -1
  23. package/data/core/style/style:syn-link-list.json +1 -1
  24. package/data/core/style/style:syn-link.json +1 -1
  25. package/data/core/style/style:syn-table-cell.json +1 -1
  26. package/data/core/style/style:syn-table.json +1 -1
  27. package/data/core/style/style:syn-weight.json +1 -1
  28. package/data/core/token/token:tokens-charts-js-index-d-ts.json +1 -1
  29. package/data/core/token/token:tokens-charts-js-index-js.json +1 -1
  30. package/data/core/token/token:tokens-charts-scss-tokens-scss.json +1 -1
  31. package/data/core/token/token:tokens-charts-themes-sick2025-dark-css.json +1 -1
  32. package/data/core/token/token:tokens-charts-themes-sick2025-light-css.json +1 -1
  33. package/data/core/token/token:tokens-figma-variables-sick2018-dark-json.json +1 -1
  34. package/data/core/token/token:tokens-figma-variables-sick2018-light-json.json +1 -1
  35. package/data/core/token/token:tokens-figma-variables-sick2025-dark-json.json +1 -1
  36. package/data/core/token/token:tokens-figma-variables-sick2025-light-json.json +1 -1
  37. package/data/core/token/token:tokens-js-index-d-ts.json +1 -1
  38. package/data/core/token/token:tokens-js-index-js.json +1 -1
  39. package/data/core/token/token:tokens-scss-tokens-scss.json +1 -1
  40. package/data/core/token/token:tokens-themes-sick2018-dark-css.json +1 -1
  41. package/data/core/token/token:tokens-themes-sick2018-light-css.json +1 -1
  42. package/data/core/token/token:tokens-themes-sick2025-dark-css.json +1 -1
  43. package/data/core/token/token:tokens-themes-sick2025-light-css.json +1 -1
  44. package/data/core/utility/utility:fonts-sick-intl.json +1 -1
  45. package/data/index.json +1 -1
  46. package/data/layers/examples/component/component:syn-chart.md +115 -106
  47. package/data/layers/examples/component/component:syn-combobox.md +0 -18
  48. package/data/layers/full/component/component:syn-chart/angular/chart.component.ts +11 -5
  49. package/data/layers/full/component/component:syn-chart/components/chart.component.ts +67 -20
  50. package/data/layers/full/component/component:syn-chart/components/chart.palettes.ts +59 -59
  51. package/data/layers/full/component/component:syn-chart/components/types.ts +47 -4
  52. package/data/layers/full/component/component:syn-chart/react/chart.ts +1 -1
  53. package/data/layers/full/component/component:syn-chart/vue/SynVueChart.vue +11 -5
  54. package/data/layers/full/setup/setup:angular-package/angular/CHANGELOG.md +32 -0
  55. package/data/layers/full/setup/setup:angular-package/angular/package.json +4 -4
  56. package/data/layers/full/setup/setup:assets-package/assets/CHANGELOG.md +8 -0
  57. package/data/layers/full/setup/setup:assets-package/assets/package.json +3 -3
  58. package/data/layers/full/setup/setup:components-package/components/CHANGELOG.md +30 -0
  59. package/data/layers/full/setup/setup:components-package/components/package.json +8 -8
  60. package/data/layers/full/setup/setup:fonts-package/fonts/CHANGELOG.md +8 -0
  61. package/data/layers/full/setup/setup:fonts-package/fonts/package.json +2 -2
  62. package/data/layers/full/setup/setup:react-package/react/CHANGELOG.md +32 -0
  63. package/data/layers/full/setup/setup:react-package/react/package.json +2 -2
  64. package/data/layers/full/setup/setup:react-package/react/syn-jsx-elements.ts +2 -2
  65. package/data/layers/full/setup/setup:styles-package/styles/CHANGELOG.md +8 -0
  66. package/data/layers/full/setup/setup:styles-package/styles/package.json +3 -3
  67. package/data/layers/full/setup/setup:tokens-package/tokens/CHANGELOG.md +27 -0
  68. package/data/layers/full/setup/setup:tokens-package/tokens/package.json +5 -5
  69. package/data/layers/full/setup/setup:vue-package/vue/CHANGELOG.md +32 -0
  70. package/data/layers/full/setup/setup:vue-package/vue/package.json +2 -2
  71. package/data/layers/full/tokens/charts/js/index.d.ts +275 -265
  72. package/data/layers/full/tokens/charts/js/index.js +143 -133
  73. package/data/layers/full/tokens/charts/scss/_tokens.scss +135 -133
  74. package/data/layers/full/tokens/charts/themes/sick2025_dark.css +135 -133
  75. package/data/layers/full/tokens/charts/themes/sick2025_light.css +135 -133
  76. package/data/layers/full/tokens/js/index.d.ts +11 -1
  77. package/data/layers/full/tokens/js/index.js +11 -1
  78. package/data/layers/full/tokens/scss/_tokens.scss +3 -1
  79. package/data/layers/full/tokens/themes/sick2018_dark.css +3 -1
  80. package/data/layers/full/tokens/themes/sick2018_light.css +3 -1
  81. package/data/layers/full/tokens/themes/sick2025_dark.css +3 -1
  82. package/data/layers/full/tokens/themes/sick2025_light.css +3 -1
  83. package/data/layers/interface/component/component:syn-chart.json +5 -5
  84. package/data/layers/interface/component/component:syn-chart.md +4 -4
  85. package/data/manifest.json +1 -1
  86. package/package.json +7 -7
@@ -13,6 +13,7 @@ The default story demonstrates a basic line chart configuration. The chart is co
13
13
  xAxis: {
14
14
  data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
15
15
  type: "category",
16
+ name: "Days",
16
17
  },
17
18
  yAxis: { type: "value" },
18
19
  };
@@ -29,12 +30,14 @@ The config property is the main way to configure the chart. It accepts an object
29
30
  ```html
30
31
  <syn-chart id="chart-config"></syn-chart>
31
32
  <script type="module">
32
- const chart = document.querySelector("#chart-config");
33
- chart.config = {
34
- series: [{ data: [150, 230, 224], type: "line" }],
35
- xAxis: { data: ["Mon", "Tue", "Wed"], type: "category" },
36
- yAxis: { type: "value" },
37
- };
33
+ const charts = document.querySelectorAll("#chart-config");
34
+ charts.forEach((chart) => {
35
+ chart.config = {
36
+ series: [{ data: [150, 230, 224], type: "line" }],
37
+ xAxis: { data: ["Mon", "Tue", "Wed"], type: "category" },
38
+ yAxis: { type: "value" },
39
+ };
40
+ });
38
41
  </script>
39
42
  ```
40
43
 
@@ -47,51 +50,53 @@ Use the palette attribute to apply a Synergy design token color palette to chart
47
50
  ```html
48
51
  <syn-chart id="chart-palette" palette="sequential-01"></syn-chart>
49
52
  <script type="module">
50
- const chart = document.querySelector("#chart-palette");
51
- chart.config = {
52
- series: [
53
- {
54
- data: [150, 230, 224, 218, 135, 147, 260],
55
- name: "Series A",
56
- type: "line",
57
- },
58
- {
59
- data: [80, 130, 180, 100, 90, 120, 200],
60
- name: "Series B",
61
- type: "line",
62
- },
63
- {
64
- data: [200, 160, 140, 170, 210, 180, 150],
65
- name: "Series C",
66
- type: "line",
67
- },
68
- {
69
- data: [100, 120, 150, 80, 70, 110, 130],
70
- name: "Series D",
71
- type: "line",
72
- },
73
- {
74
- data: [180, 200, 170, 190, 220, 210, 240],
75
- name: "Series E",
76
- type: "line",
77
- },
78
- {
79
- data: [90, 110, 130, 70, 60, 100, 120],
80
- name: "Series F",
81
- type: "line",
82
- },
83
- {
84
- data: [160, 190, 150, 200, 230, 220, 250],
85
- name: "Series G",
86
- type: "line",
53
+ const charts = document.querySelectorAll("#chart-palette");
54
+ charts.forEach((chart) => {
55
+ chart.config = {
56
+ series: [
57
+ {
58
+ data: [150, 230, 224, 218, 135, 147, 260],
59
+ name: "Series A",
60
+ type: "line",
61
+ },
62
+ {
63
+ data: [80, 130, 180, 100, 90, 120, 200],
64
+ name: "Series B",
65
+ type: "line",
66
+ },
67
+ {
68
+ data: [200, 160, 140, 170, 210, 180, 150],
69
+ name: "Series C",
70
+ type: "line",
71
+ },
72
+ {
73
+ data: [100, 120, 150, 80, 70, 110, 130],
74
+ name: "Series D",
75
+ type: "line",
76
+ },
77
+ {
78
+ data: [180, 200, 170, 190, 220, 210, 240],
79
+ name: "Series E",
80
+ type: "line",
81
+ },
82
+ {
83
+ data: [90, 110, 130, 70, 60, 100, 120],
84
+ name: "Series F",
85
+ type: "line",
86
+ },
87
+ {
88
+ data: [160, 190, 150, 200, 230, 220, 250],
89
+ name: "Series G",
90
+ type: "line",
91
+ },
92
+ ],
93
+ xAxis: {
94
+ data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
95
+ type: "category",
87
96
  },
88
- ],
89
- xAxis: {
90
- data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
91
- type: "category",
92
- },
93
- yAxis: { type: "value" },
94
- };
97
+ yAxis: { type: "value" },
98
+ };
99
+ });
95
100
  </script>
96
101
  ```
97
102
 
@@ -114,20 +119,22 @@ Use getInstance() to access the underlying ECharts instance directly and work wi
114
119
  event payload.
115
120
  </p>
116
121
  <script type="module">
117
- const chart = document.querySelector("#chart-get-instance");
118
- chart.config = {
119
- series: [{ data: [150, 230, 224, 218, 135, 147, 260], type: "line" }],
120
- tooltip: { trigger: "item" },
121
- xAxis: {
122
- data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
123
- type: "category",
124
- },
125
- yAxis: { type: "value" },
126
- };
127
- const chartInstance = chart.getInstance();
128
- chartInstance.on("click", (params) =>
129
- console.log("ECharts click event:", params),
130
- );
122
+ const charts = document.querySelectorAll("#chart-get-instance");
123
+ charts.forEach((chart) => {
124
+ chart.config = {
125
+ series: [{ data: [150, 230, 224, 218, 135, 147, 260], type: "line" }],
126
+ tooltip: { trigger: "item" },
127
+ xAxis: {
128
+ data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
129
+ type: "category",
130
+ },
131
+ yAxis: { type: "value" },
132
+ };
133
+ const chartInstance = chart.getInstance();
134
+ chartInstance.on("click", (params) =>
135
+ console.log("ECharts click event:", params),
136
+ );
137
+ });
131
138
  </script>
132
139
  ```
133
140
 
@@ -140,52 +147,54 @@ You can use multiple charts in one <syn-chart> instance, each with its own confi
140
147
  ```html
141
148
  <syn-chart id="chart-multiple-charts" palette="categorical"></syn-chart>
142
149
  <script type="module">
143
- const chart = document.querySelector("#chart-multiple-charts");
150
+ const charts = document.querySelectorAll("#chart-multiple-charts");
144
151
 
145
152
  const getHexValueFromVariable = (val) =>
146
153
  getComputedStyle(document.documentElement).getPropertyValue(val).trim();
147
154
 
148
- chart.config = {
149
- series: [
150
- {
151
- data: [160, 185, 180, 175, 150, 160, 190],
152
- name: "Series A",
153
- type: "line",
154
- },
155
- {
156
- data: [170, 165, 155, 168, 180, 170, 158],
157
- name: "Series B",
158
- type: "line",
159
- },
160
- {
161
- data: [165, 175, 158, 172, 182, 175, 185],
162
- name: "Series C",
163
- type: "line",
164
- },
165
- {
166
- color: [getHexValueFromVariable("--syn-sequential-05-80")],
167
- data: [80, 60, 90, 50, 70, 55, 85],
168
- name: "Series D",
169
- type: "line",
170
- },
171
- {
172
- color: [getHexValueFromVariable("--syn-sequential-05-60")],
173
- data: [65, 75, 55, 80, 45, 70, 60],
174
- name: "Series E",
175
- type: "line",
176
- },
177
- {
178
- color: [getHexValueFromVariable("--syn-sequential-05-40")],
179
- data: [50, 70, 60, 45, 55, 65, 75],
180
- name: "Series F",
181
- type: "line",
155
+ charts.forEach((chart) => {
156
+ chart.config = {
157
+ series: [
158
+ {
159
+ data: [160, 185, 180, 175, 150, 160, 190],
160
+ name: "Series A",
161
+ type: "line",
162
+ },
163
+ {
164
+ data: [170, 165, 155, 168, 180, 170, 158],
165
+ name: "Series B",
166
+ type: "line",
167
+ },
168
+ {
169
+ data: [165, 175, 158, 172, 182, 175, 185],
170
+ name: "Series C",
171
+ type: "line",
172
+ },
173
+ {
174
+ color: [getHexValueFromVariable("--syn-sequential-05-80")],
175
+ data: [80, 60, 90, 50, 70, 55, 85],
176
+ name: "Series D",
177
+ type: "line",
178
+ },
179
+ {
180
+ color: [getHexValueFromVariable("--syn-sequential-05-60")],
181
+ data: [65, 75, 55, 80, 45, 70, 60],
182
+ name: "Series E",
183
+ type: "line",
184
+ },
185
+ {
186
+ color: [getHexValueFromVariable("--syn-sequential-05-40")],
187
+ data: [50, 70, 60, 45, 55, 65, 75],
188
+ name: "Series F",
189
+ type: "line",
190
+ },
191
+ ],
192
+ xAxis: {
193
+ data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
194
+ type: "category",
182
195
  },
183
- ],
184
- xAxis: {
185
- data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
186
- type: "category",
187
- },
188
- yAxis: { type: "value" },
189
- };
196
+ yAxis: { type: "value" },
197
+ };
198
+ });
190
199
  </script>
191
200
  ```
@@ -491,24 +491,6 @@ The filtered options shown in the list can be customized by passing a function t
491
491
  // the highlight option renderer utility function can be imported via:
492
492
  // import { highlightOptionRenderer } from '@synergy-design-system/components';
493
493
 
494
- // preview-ignore:start
495
- const highlightOptionRenderer = (e, t) => {
496
- if (!t) return e;
497
- let n = e.cloneNode(!0),
498
- r = n.getTextLabel();
499
- n.selected = e.selected;
500
- let i = r.toLowerCase().indexOf(t.toLowerCase()),
501
- a = n.innerHTML.indexOf(r),
502
- o = document.createElement(`mark`);
503
- ((o.textContent = r.slice(i, i + t.length)),
504
- o.classList.add(`syn-highlight-style`));
505
- let s = r.replace(new RegExp(t, `i`), o.outerHTML),
506
- c = n.innerHTML.slice(0, a),
507
- l = n.innerHTML.slice(a + r.length);
508
- return ((n.innerHTML = c.concat(s, l)), n);
509
- };
510
- // preview-ignore:end
511
-
512
494
  const comboboxes = document.querySelectorAll(".highlight-combobox");
513
495
  comboboxes.forEach((combobox) => {
514
496
  combobox.getOption = highlightOptionRenderer;
@@ -21,7 +21,7 @@ import '@synergy-design-system/components/components/chart/chart.js';
21
21
  *
22
22
  * @documentation https://synergy-design-system.github.io/?path=/docs/charting-syn-chart--docs
23
23
  * @status experimental
24
- * @since 0.0.0
24
+ * @since 3.15.0
25
25
  *
26
26
  * @csspart base - The component's base wrapper.
27
27
  */
@@ -61,16 +61,22 @@ it takes precedence over the palette.
61
61
  }
62
62
 
63
63
  /**
64
- * The ECharts configuration option object.
64
+ * The ECharts configuration input.
65
65
 
66
- This property maps 1:1 to the ECharts `option` parameter passed to `setOption()`.
66
+ This property accepts either:
67
+ - a plain `ECConfig` object, or
68
+ - a callback that receives a typed preset handle and applies chart presets.
69
+
70
+ The resolved result maps 1:1 to the ECharts `option` parameter passed to
71
+ `setOption()`.
67
72
  Consult the [ECharts option documentation](https://echarts.apache.org/en/option.html)
68
- and assign the object directly to this property.
73
+ and assign either the object directly or build it through the handle.
69
74
 
70
75
  > **Note:** Currently only **line charts** (`series[].type: 'line'`) are supported.
71
76
  > Support for additional chart types (bar, pie, etc.) will be added in future releases or can be requested.
72
77
 
73
- Assigning a new object completely replaces the previous chart configuration (`notMerge: true`).
78
+ Assigning a new config input completely replaces the previous chart
79
+ configuration (`notMerge: true`).
74
80
  To update only parts of the chart, access the underlying ECharts instance directly and
75
81
  call `setOption()` with custom merge options.
76
82
  */
@@ -1,5 +1,5 @@
1
1
  import {
2
- type EChartsType, init, use,
2
+ type EChartsType, init, registerPreprocessor, registerTheme, use,
3
3
  } from 'echarts/core.js';
4
4
  import { CanvasRenderer } from 'echarts/renderers.js';
5
5
  import { html } from 'lit';
@@ -10,12 +10,14 @@ import { LineChart } from 'echarts/charts.js';
10
10
  import {
11
11
  GridComponent, LegendComponent, TitleComponent, TooltipComponent,
12
12
  } from 'echarts/components.js';
13
- import { classMap } from 'lit/directives/class-map.js';
14
13
  import SynergyElement from '../../internal/synergy-element.js';
15
14
  import componentStyles from '../../styles/component.styles.js';
16
15
  import styles from './chart.styles.js';
17
- import { PALETTE_TOKENS, type SynChartPalette } from './chart.palettes.js';
18
- import type { ECConfig } from './types.js';
16
+ import { type ChartPalette, PALETTE_TOKENS } from './chart.palettes.js';
17
+ import { resolveConfigInput } from './configs/config.js';
18
+ import type { ChartConfigType, ECConfig } from './types.js';
19
+ import { synergyLightTheme } from './themes/light.js';
20
+ import { applyAxisDefaultsPreprocessor } from './configs/axes/utilities.js';
19
21
 
20
22
  // TODO: Check, should we let the user define the *use* so the bundle size is optimized for their specific use case?
21
23
  use([
@@ -32,7 +34,7 @@ use([
32
34
  *
33
35
  * @documentation https://synergy-design-system.github.io/?path=/docs/charting-syn-chart--docs
34
36
  * @status experimental
35
- * @since 0.0.0
37
+ * @since 3.15.0
36
38
  *
37
39
  * @csspart base - The component's base wrapper.
38
40
  */
@@ -49,31 +51,59 @@ export default class SynChart extends SynergyElement {
49
51
 
50
52
  private resizeObserver: ResizeObserver;
51
53
 
54
+ private resolvedConfig: ECConfig = {};
55
+
52
56
  /**
53
- * The ECharts configuration option object.
57
+ * The ECharts configuration input.
58
+ *
59
+ * This property accepts either:
60
+ * - a plain `ECConfig` object, or
61
+ * - a callback that receives a typed preset handle and applies chart presets.
54
62
  *
55
- * This property maps 1:1 to the ECharts `option` parameter passed to `setOption()`.
63
+ * The resolved result maps 1:1 to the ECharts `option` parameter passed to
64
+ * `setOption()`.
56
65
  * Consult the [ECharts option documentation](https://echarts.apache.org/en/option.html)
57
- * and assign the object directly to this property.
66
+ * and assign either the object directly or build it through the handle.
58
67
  *
59
68
  * > **Note:** Currently only **line charts** (`series[].type: 'line'`) are supported.
60
69
  * > Support for additional chart types (bar, pie, etc.) will be added in future releases or can be requested.
61
70
  *
62
- * Assigning a new object completely replaces the previous chart configuration (`notMerge: true`).
71
+ * Assigning a new config input completely replaces the previous chart
72
+ * configuration (`notMerge: true`).
63
73
  * To update only parts of the chart, access the underlying ECharts instance directly and
64
74
  * call `setOption()` with custom merge options.
65
75
  *
66
76
  * @example
67
77
  * ```js
78
+ * // Using a plain object
68
79
  * chart.config = {
69
80
  * xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed'] },
70
81
  * yAxis: { type: 'value' },
71
82
  * series: [{ type: 'line', data: [150, 230, 224] }],
72
83
  * };
84
+ *
85
+ * // Using the handle with method chaining
86
+ * chart.config = (handle) => handle
87
+ * .baseConfig({
88
+ * xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed'] },
89
+ * yAxis: { type: 'value' },
90
+ * series: [{ type: 'line', data: [150, 230, 224] }],
91
+ * })
92
+ * .axesShowSplitLines();
93
+ *
94
+ * // Using the handle with sequential calls
95
+ * chart.config = (handle) => {
96
+ * handle.baseConfig({
97
+ * xAxis: { type: 'category', data: ['Mon', 'Tue', 'Wed'] },
98
+ * yAxis: { type: 'value' },
99
+ * series: [{ type: 'line', data: [150, 230, 224] }],
100
+ * });
101
+ * handle.axesShowSplitLines();
102
+ * };
73
103
  * ```
74
104
  */
75
105
  @property({ attribute: false })
76
- config: ECConfig = {};
106
+ config: ChartConfigType = {};
77
107
 
78
108
  /**
79
109
  * The color palette to apply to chart series.
@@ -88,13 +118,13 @@ export default class SynChart extends SynergyElement {
88
118
  * it takes precedence over the palette.
89
119
  */
90
120
  @property({ reflect: true })
91
- palette: SynChartPalette = 'categorical';
121
+ palette: ChartPalette = 'categorical';
92
122
 
93
123
  /** Resolves palette CSS custom properties to computed color values and applies them to the chart. */
94
124
  private applyPalette(): void {
95
125
  if (!this.chartInstance) return;
96
126
  // If the user explicitly set config.color, respect it — palette is a default only
97
- if (Array.isArray(this.config.color) && this.config.color.length > 0) return;
127
+ if (Array.isArray(this.resolvedConfig.color) && this.resolvedConfig.color.length > 0) return;
98
128
 
99
129
  const tokens = PALETTE_TOKENS[this.palette];
100
130
  const computedStyles = getComputedStyle(this);
@@ -103,23 +133,41 @@ export default class SynChart extends SynergyElement {
103
133
  .filter(Boolean);
104
134
 
105
135
  if (colors.length > 0) {
106
- this.chartInstance.setOption({ color: colors }, { notMerge: false });
136
+ const oldOption = this.chartInstance.getOption();
137
+ if (!oldOption) return;
138
+
139
+ oldOption.color = colors;
140
+ // We can not only replace 'color' via { replaceMerge: ['color'] }. Echarts does not allow to do this.
141
+ // Therefore we need to completely replace it, with the old option but new color.
142
+ this.chartInstance.setOption(oldOption, { notMerge: true });
107
143
  }
108
144
  }
109
145
 
110
146
  protected updated(changedProperties: PropertyValues<this>): void {
111
147
  if (changedProperties.has('config') && this.chartInstance) {
112
- this.chartInstance.setOption(this.config, { notMerge: true });
148
+ this.resolvedConfig = resolveConfigInput(this.config);
149
+ this.chartInstance.setOption(this.resolvedConfig, { notMerge: true });
113
150
  }
114
151
  if ((changedProperties.has('palette') || changedProperties.has('config')) && this.chartInstance) {
115
152
  this.applyPalette();
116
153
  }
117
154
  }
118
155
 
156
+ connectedCallback() {
157
+ super.connectedCallback();
158
+ registerTheme('default', synergyLightTheme);
159
+ /**
160
+ * Depending if x-axis or y-axis, the axis name has different positions and alignments. This preprocessor ensures that the correct styles are applied to the axis names based on the axis type.
161
+ * This is needed because ECharts does not provide a way to set specific styles for x and y axis, only for axis types.
162
+ */
163
+ registerPreprocessor(applyAxisDefaultsPreprocessor);
164
+ }
165
+
119
166
  // Initialize echarts instance and resize observer
120
167
  protected firstUpdated(_changedProperties: PropertyValues): void {
121
168
  if (this.chartContainer !== null && this.chartContainer !== undefined) {
122
- this.chartInstance = init(this.chartContainer);
169
+ this.chartInstance = init(this.chartContainer, 'default');
170
+
123
171
  // Resize observer
124
172
  this.resizeObserver = new ResizeObserver(() => {
125
173
  this.chartInstance?.resize();
@@ -127,8 +175,9 @@ export default class SynChart extends SynergyElement {
127
175
  this.resizeObserver.observe(this.chartContainer);
128
176
 
129
177
  // Apply config if already set before first render
130
- if (Object.keys(this.config).length > 0) {
131
- this.chartInstance.setOption(this.config);
178
+ this.resolvedConfig = resolveConfigInput(this.config);
179
+ if (Object.keys(this.resolvedConfig).length > 0) {
180
+ this.chartInstance.setOption(this.resolvedConfig);
132
181
  }
133
182
  // Apply palette after config so colors blend in without replacing the full config
134
183
  this.applyPalette();
@@ -172,9 +221,7 @@ export default class SynChart extends SynergyElement {
172
221
  return html`
173
222
  <div
174
223
  part="base"
175
- class=${classMap({
176
- chart: true,
177
- })}>
224
+ class="chart">
178
225
  </div>
179
226
  `;
180
227
  }