Prerequisites
Affected component
SiChartCartesian
Summary
Bug Report: DatasetComponent not registered, causing dataset configuration to be ignored in ECharts 6
Summary
After upgrading to @siemens/charts-ng v48+ (which includes ECharts 6.0.0), chart options using the dataset configuration are silently ignored. Scatter data points and other data specified via dataset.source are not rendered, and no error is logged to the console.
Root Cause
ECharts 6.0.0 introduced stricter tree-shaking, requiring explicit registration of all components via echarts.use(). The library registers chart types (ScatterChart, LineChart, etc.) and various components (GridComponent, LegendComponent, MarkLineComponent, etc.), but DatasetComponent is not registered.
Files affected:
projects/charts-ng/chart/si-chart.component.ts (lines 34-55)
projects/charts-ng/cartesian/si-chart-cartesian.component.ts (lines 44-61)
Without DatasetComponent, the dataset option in chart configuration is silently ignored by ECharts.
Current Workaround
Consumers can register DatasetComponent themselves before using the chart:
import { DatasetComponent } from 'echarts/components';
import * as echarts from 'echarts/core';
echarts.use([DatasetComponent]);
Recommended Fix
Register DatasetComponent in the library's chart components:
projects/charts-ng/chart/si-chart.component.ts:
import { DatasetComponent } from 'echarts/components';
echarts.use([
// ... existing registrations
DatasetComponent,
LegendComponent,
// ...
]);
projects/charts-ng/cartesian/si-chart-cartesian.component.ts:
import { DatasetComponent } from 'echarts/components';
echarts.use([
// ... existing registrations
DatasetComponent,
LegendComponent,
// ...
]);
Additional Context
The DatasetComponentOption type is already exported from echarts.model.ts, indicating the library intends to support dataset configuration. This was simply missed during the ECharts 6 migration.
### Version
@siemens/charts-ng: >= 48.0.0
### Steps to reproduce
```typescript
// Component using dataset configuration
chartOptions: ECBasicOption = {
dataset: {
source: [
{ x: 10, y: 20 },
{ x: 15, y: 35 },
],
},
series: [
{
type: 'scatter',
// No explicit data array - relies on dataset
},
],
xAxis: { type: 'value' },
yAxis: { type: 'value' },
};
Code reproduction example
no link
What is the current bug behavior
No scatter points are rendered. The chart appears empty with no console errors.
What is the expected correct behavior
Data from dataset is displayed correctly.
Prerequisites
Affected component
SiChartCartesian
Summary
Bug Report: DatasetComponent not registered, causing dataset configuration to be ignored in ECharts 6
Summary
After upgrading to
@siemens/charts-ngv48+ (which includes ECharts 6.0.0), chart options using thedatasetconfiguration are silently ignored. Scatter data points and other data specified viadataset.sourceare not rendered, and no error is logged to the console.Root Cause
ECharts 6.0.0 introduced stricter tree-shaking, requiring explicit registration of all components via
echarts.use(). The library registers chart types (ScatterChart,LineChart, etc.) and various components (GridComponent,LegendComponent,MarkLineComponent, etc.), butDatasetComponentis not registered.Files affected:
projects/charts-ng/chart/si-chart.component.ts(lines 34-55)projects/charts-ng/cartesian/si-chart-cartesian.component.ts(lines 44-61)Without
DatasetComponent, thedatasetoption in chart configuration is silently ignored by ECharts.Current Workaround
Consumers can register
DatasetComponentthemselves before using the chart:Recommended Fix
Register
DatasetComponentin the library's chart components:projects/charts-ng/chart/si-chart.component.ts:projects/charts-ng/cartesian/si-chart-cartesian.component.ts:Additional Context
The
DatasetComponentOptiontype is already exported fromecharts.model.ts, indicating the library intends to support dataset configuration. This was simply missed during the ECharts 6 migration.Code reproduction example
no link
What is the current bug behavior
No scatter points are rendered. The chart appears empty with no console errors.
What is the expected correct behavior
Data from dataset is displayed correctly.