@porscheinformatik/clr-addons 19.18.2 → 19.18.3
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.
|
@@ -1478,6 +1478,7 @@ class ComboChartComponent extends ChartBase {
|
|
|
1478
1478
|
const lineItems = this.lineSeries().map(s => ({ label: s.label, color: s.color }));
|
|
1479
1479
|
return [...barItems, ...lineItems];
|
|
1480
1480
|
});
|
|
1481
|
+
this._clipIdCounter = 0;
|
|
1481
1482
|
}
|
|
1482
1483
|
// ── Lifecycle ────────────────────────────────────────────────────────────────
|
|
1483
1484
|
ngOnChanges(_changes) {
|
|
@@ -1535,6 +1536,19 @@ class ComboChartComponent extends ChartBase {
|
|
|
1535
1536
|
.domain([0, maxLine || 1])
|
|
1536
1537
|
.nice(this.yLineMax() === undefined ? undefined : 0)
|
|
1537
1538
|
.range([height, 0]);
|
|
1539
|
+
// ── SVG ClipPath ─────────────────────────────────────────────────────────
|
|
1540
|
+
// Ensures bars/lines that exceed the Y-axis maximum (yBarMax/yLineMax) are
|
|
1541
|
+
// visually clipped at the chart boundary without modifying the data values.
|
|
1542
|
+
const clipId = `combo-clip-${this._clipIdCounter++}`;
|
|
1543
|
+
this.svg
|
|
1544
|
+
.append('defs')
|
|
1545
|
+
.append('clipPath')
|
|
1546
|
+
.attr('id', clipId)
|
|
1547
|
+
.append('rect')
|
|
1548
|
+
.attr('x', 0)
|
|
1549
|
+
.attr('y', 0)
|
|
1550
|
+
.attr('width', width)
|
|
1551
|
+
.attr('height', height);
|
|
1538
1552
|
const g = this.svg
|
|
1539
1553
|
.attr('width', width)
|
|
1540
1554
|
.attr('height', height)
|
|
@@ -1577,8 +1591,11 @@ class ComboChartComponent extends ChartBase {
|
|
|
1577
1591
|
.text(this.yLineAxisLabel());
|
|
1578
1592
|
}
|
|
1579
1593
|
}
|
|
1580
|
-
|
|
1581
|
-
|
|
1594
|
+
// Wrap chart content in a clipped group so elements exceeding the Y max
|
|
1595
|
+
// are not visible beyond the chart boundary.
|
|
1596
|
+
const contentGroup = g.append('g').attr('clip-path', `url(#${clipId})`);
|
|
1597
|
+
this.drawBars(contentGroup, x, yBar);
|
|
1598
|
+
this.drawLines(contentGroup, x, yLine);
|
|
1582
1599
|
}
|
|
1583
1600
|
drawBars(g, x, y) {
|
|
1584
1601
|
// Running stack base (cumulative sum) per X key across all bar series
|