@swimlane/ngx-charts 20.2.2-beta.3 → 20.2.2-beta.5
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.
|
@@ -1509,6 +1509,12 @@ class XAxisTicksComponent {
|
|
|
1509
1509
|
this.textAnchor = TextAnchor.Middle;
|
|
1510
1510
|
}
|
|
1511
1511
|
if (this.isWrapTicksSupported) {
|
|
1512
|
+
// for SSR, if there is no angle, calculate height based on number of tick lines
|
|
1513
|
+
if (!isPlatformBrowser(this.platformId) && (angle === 0 || angle === null)) {
|
|
1514
|
+
const longestTick = this.ticks.reduce((savedText, text) => (text.length > savedText.length ? text : savedText), '');
|
|
1515
|
+
const tickLines = this.tickChunks(longestTick);
|
|
1516
|
+
this.approxHeight = 10 * (tickLines.length || 1);
|
|
1517
|
+
}
|
|
1512
1518
|
this.maxPossibleLengthForTick = this.getMaxPossibleLengthForTick(this.ticks);
|
|
1513
1519
|
}
|
|
1514
1520
|
setTimeout(() => this.updateDims());
|
|
@@ -1582,14 +1588,14 @@ class XAxisTicksComponent {
|
|
|
1582
1588
|
const maxAllowedLines = 5;
|
|
1583
1589
|
let maxLines = this.rotateTicks ? Math.floor(this.scale.step() / 14) : maxAllowedLines;
|
|
1584
1590
|
if (maxLines <= 1) {
|
|
1585
|
-
return [label];
|
|
1591
|
+
return [this.tickTrim(label)];
|
|
1586
1592
|
}
|
|
1587
1593
|
const possibleStringLength = Math.max(this.maxPossibleLengthForTick, this.maxTickLength);
|
|
1588
1594
|
maxLines = Math.min(maxLines, maxAllowedLines);
|
|
1589
1595
|
const lines = getTickLines(label, possibleStringLength, maxLines < 1 ? 1 : maxLines);
|
|
1590
1596
|
return lines;
|
|
1591
1597
|
}
|
|
1592
|
-
return [label];
|
|
1598
|
+
return [this.tickTrim(label)];
|
|
1593
1599
|
}
|
|
1594
1600
|
}
|
|
1595
1601
|
XAxisTicksComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.0", ngImport: i0, type: XAxisTicksComponent, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
|