Skip to content

Commit 5e40442

Browse files
committed
Version 5.17.3
1 parent 4503d83 commit 5e40442

12 files changed

Lines changed: 230 additions & 17 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "@amcharts/amcharts5",
4-
"version": "5.17.2",
4+
"version": "5.17.3",
55
"author": "amCharts <contact@amcharts.com> (https://www.amcharts.com/)",
66
"description": "amCharts 5",
77
"homepage": "https://www.amcharts.com/",

packages/shared/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55
Please note, that this project, while following numbering syntax, it DOES NOT
66
adhere to [Semantic Versioning](http://semver.org/spec/v2.0.0.html) rules.
77

8+
## [5.17.3] - 2026-05-29
9+
10+
### Added
11+
- `Label` setting `fontFamily` now accepts special value of `"inherit"`. If set it will automatically use computer `fontFamily` value on chart's DOM container.
12+
- `onDebounced(key, callback, delay)` and `offDebounced(key, callback?)` methods added to all entities. Like `on()`/`off()` for settings, but the callback fires only once after rapid changes settle, waiting `delay` milliseconds since the last change.
13+
- `onPrivateDebounced(key, callback, delay)` and `offDebouncedPrivate(key, callback?)` — same as above for private settings.
14+
15+
### Fixed
16+
- The underline text for a `Label` could render thicker in some cases.
17+
- `GanttSeries` was not syncing the `end` field back to data context when tasks were moved or resized, causing stale values when serializing data or calculating linked group positions.
18+
- `Gantt.addNewTask()` was setting a hardcoded stale `end` value in new task data.
19+
- If `Root` was placed in a ShadowDOM, TAB would select non-visible focusable elements.
20+
- Accessibility: The text for readable tooltip element had in-line formatting text in them.
21+
22+
823
## [5.17.2] - 2026-04-16
924

1025
### Changed

src/.internal/charts/gantt/Gantt.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,6 @@ export class Gantt extends Container {
786786

787787
const seriesDataObject: any = {
788788
start: start,
789-
end: start + 1,
790789
duration: duration,
791790
progress: progress,
792791
id: uid,

src/.internal/charts/gantt/GanttSeries.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,10 +761,12 @@ export class GanttSeries extends ColumnSeries {
761761

762762

763763
delete (dataContext[this.get("openValueXField")]);
764+
delete (dataContext[this.get("valueXField")]);
764765
delete (dataContext[this.get("durationField")]);
765766
}
766767
else {
767768
dataContext[this.get("openValueXField")] = dataItem.get("openValueX");
769+
dataContext[this.get("valueXField")] = dataItem.get("valueX");
768770
dataContext[this.get("durationField")] = dataItem.get("duration");
769771
dataContext[this.get("progressField")] = dataItem.get("progress");
770772
}

src/.internal/charts/stock/drawing/LabelSeries.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ export interface ILabelSeriesSettings extends IPolylineSeriesSettings {
2525

2626
/**
2727
* Label font family.
28+
*
29+
* Use reserved value `"inherit"` to use computed style on chart
30+
* container. (since `5.17.3`)
2831
*/
2932
labelFontFamily?: string;
3033

@@ -332,7 +335,7 @@ export class LabelSeries extends PolylineSeries {
332335
}
333336

334337
protected _handleBulletDragStart(event: ISpritePointerEvent) {
335-
// don't call super
338+
// don't call super
336339
const stockChart = this._getStockChart();
337340
if (stockChart) {
338341
stockChart._dragStartDrawing(event);
@@ -355,4 +358,4 @@ export class LabelSeries extends PolylineSeries {
355358
grip.set("forceInactive", !enabled);
356359
})
357360
}
358-
}
361+
}

src/.internal/charts/stock/toolbar/DrawingControl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ export interface IDrawingControlSettings extends IStockControlSettings {
150150

151151
/**
152152
* Default label font.
153+
*
154+
* Use reserved value `"inherit"` to use computed style on chart
155+
* container. (since `5.17.3`)
153156
*/
154157
labelFontFamily?: string;
155158

src/.internal/core/Registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export class Registry {
55
/**
66
* Currently running version of amCharts.
77
*/
8-
readonly version: string = "5.17.2";
8+
readonly version: string = "5.17.3";
99

1010
/**
1111
* List of applied licenses.

src/.internal/core/Root.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ export class Root implements IDisposer {
10481048
allParents[parent.uid] = parent;
10491049
parent._prepareChildren();
10501050
}
1051-
});
1051+
});
10521052
}
10531053

10541054
$object.entries(allParents).forEach(([_key, parent]) => {
@@ -1067,7 +1067,7 @@ export class Root implements IDisposer {
10671067
entity._beforeChanged();
10681068
}
10691069
});
1070-
1070+
10711071
// console.log("_changed")
10721072
objects.forEach((entity) => {
10731073
entity._changed();
@@ -1825,7 +1825,19 @@ export class Root implements IDisposer {
18251825
return;
18261826
}
18271827

1828-
const focusableElements = Array.from(document.querySelectorAll([
1828+
const rootNode = this.dom.getRootNode ? this.dom.getRootNode() : null;
1829+
let queryRoot: Document | ShadowRoot = this.dom.ownerDocument || document;
1830+
1831+
if (rootNode) {
1832+
if (typeof ShadowRoot !== "undefined" && rootNode instanceof ShadowRoot) {
1833+
queryRoot = rootNode;
1834+
}
1835+
else if (rootNode instanceof Document) {
1836+
queryRoot = rootNode;
1837+
}
1838+
}
1839+
1840+
const focusableElements = Array.from(queryRoot.querySelectorAll([
18291841
'a[href]',
18301842
'area[href]',
18311843
'button:not([disabled])',
@@ -1860,7 +1872,9 @@ export class Root implements IDisposer {
18601872
}
18611873
}
18621874

1863-
targetElement.focus();
1875+
if (targetElement) {
1876+
targetElement.focus();
1877+
}
18641878
}
18651879

18661880
protected _handleBlur(ev: FocusEvent): void {
@@ -1888,7 +1902,7 @@ export class Root implements IDisposer {
18881902
return;
18891903
}
18901904

1891-
const text = $utils.stripTags(target._getText());
1905+
const text = $utils.stripFormatTags($utils.stripTags(target._getText()));
18921906
let tooltipElement = target.getPrivate("tooltipElement");
18931907
if (target.get("role") == "tooltip" && text != "") {
18941908
if (!tooltipElement) {

src/.internal/core/render/Label.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface ILabelSettings extends IContainerSettings {
1616
/**
1717
* Labels' text.
1818
* @see {@link https://www.amcharts.com/docs/v5/concepts/formatters/text-styling/} for text styling info
19-
*
19+
*
2020
*/
2121
text?: string;
2222

@@ -50,6 +50,9 @@ export interface ILabelSettings extends IContainerSettings {
5050
* Font family to use for the label.
5151
*
5252
* Multiple fonts can be separated by commas.
53+
*
54+
* Use reserved value `"inherit"` to use computed style on chart
55+
* container. (since `5.17.3`)
5356
*/
5457
fontFamily?: string;
5558

@@ -223,7 +226,7 @@ export interface ILabelSettings extends IContainerSettings {
223226
*
224227
* If the `text` is longer than `maxChars`, the text will be truncated
225228
* using the `breakWords` and `ellipsis` settings.
226-
*
229+
*
227230
* @since 5.7.2
228231
*/
229232
maxChars?: number;

src/.internal/core/render/backend/CanvasRenderer.ts

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ class Shadow extends Op {
10901090
context.shadowOffsetY = this.offsetY;
10911091
}
10921092

1093-
public colorizeGhost(_context: CanvasRenderingContext2D, _forceColor: string | undefined): void {}
1093+
public colorizeGhost(_context: CanvasRenderingContext2D, _forceColor: string | undefined): void { }
10941094
}
10951095

10961096
/**
@@ -1764,7 +1764,10 @@ export class CanvasText extends CanvasDisplayObject implements IText {
17641764
fontStyle.push(style.fontSize);
17651765
}
17661766

1767-
if (style2 && style2.fontFamily) {
1767+
if (style.fontFamily == "inherit") {
1768+
fontStyle.push(getComputedStyle(this._renderer.view).getPropertyValue("font-family"));
1769+
}
1770+
else if (style2 && style2.fontFamily) {
17681771
fontStyle.push(style2.fontFamily);
17691772
}
17701773
else if (style.fontFamily) {
@@ -1882,6 +1885,8 @@ export class CanvasText extends CanvasDisplayObject implements IText {
18821885
y = thickness + offset * 1.5 + line.offsetY + chunk.offsetY;
18831886
}
18841887

1888+
y = Math.round(y);
1889+
18851890
if (!ghostOnly) {
18861891
context.save();
18871892
context.beginPath();
@@ -2124,6 +2129,26 @@ export class CanvasText extends CanvasDisplayObject implements IText {
21242129
this.textVisible = true;
21252130
return false;
21262131
}
2132+
2133+
// _truncateText() may return text that still overflows (a single
2134+
// word wider than the remaining space when word-breaking is not
2135+
// allowed). If the line already has content, move the WHOLE chunk
2136+
// to the next line instead of letting it overflow.
2137+
if (!firstTextChunk) {
2138+
const tmpMetrics = this._measureText($utils.trim(tmpText), context);
2139+
const tmpWidth = tmpMetrics.actualBoundingBoxLeft + tmpMetrics.actualBoundingBoxRight;
2140+
if (tmpWidth > excessWidth) {
2141+
leftoverChunks = chunks.slice(index);
2142+
if (currentFormat) {
2143+
leftoverChunks.unshift({
2144+
type: "format",
2145+
text: currentFormat
2146+
});
2147+
}
2148+
chunks = [];
2149+
return false;
2150+
}
2151+
}
21272152
//skipFurtherText = true;
21282153

21292154
//Add remaining chunks for the next line
@@ -2357,7 +2382,9 @@ export class CanvasText extends CanvasDisplayObject implements IText {
23572382
text = text.slice(0, -1);
23582383
}
23592384
else {
2360-
let tmp = text.replace(/[^,;:!?\\\/\s]+[,;:!?\\\/\s]*$/g, "");
2385+
// A comma directly followed by a digit is a numeric separator (e.g.
2386+
// "1,200,300"), not a word boundary - keep such numbers unbroken.
2387+
let tmp = text.replace(/(?:[^,;:!?\\\/\s]|,(?=\d))+[,;:!?\\\/\s]*$/g, "");
23612388
if ((tmp == "" || tmp === text) && fallbackBreakWords) {
23622389
breakWords = true;
23632390
}
@@ -3137,7 +3164,7 @@ interface IEvents<Key extends keyof IRendererEvents> {
31373164
*/
31383165
export class CanvasRenderer extends ArrayDisposer implements IRenderer, IDisposer {
31393166
public view: HTMLElement = document.createElement("div");
3140-
protected _layerDom: HTMLElement = document.createElement("div");
3167+
public _layerDom: HTMLElement = document.createElement("div");
31413168

31423169
public layers: Array<CanvasLayer> = [];
31433170
public _dirtyLayers: Array<CanvasLayer> = [];

0 commit comments

Comments
 (0)