Skip to content

Commit ec8b59d

Browse files
committed
Version 5.13.6
1 parent 2c43ea2 commit ec8b59d

File tree

8 files changed

+44
-26
lines changed

8 files changed

+44
-26
lines changed

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.13.5",
4+
"version": "5.13.6",
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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ 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.13.6] - 2025-08-27
9+
10+
### Fixed
11+
- In some cases, `DurationFormatter` could display incorrect number of days.
12+
- The selector tool in `StockChart`'s drawing mode was not working properly since `5.13.4`.
13+
14+
815
## [5.13.5] - 2025-08-05
916

1017
### Fixed

src/.internal/charts/stock/StockChart.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export interface IStockChartPrivate extends IContainerPrivate {
178178
mainAxis?: DateAxis<AxisRenderer>
179179

180180

181-
drawingSelectionEnabled?: boolean;
181+
drawingSelectionEnabled?: boolean;
182182
}
183183

184184
export interface IStockChartEvents extends IContainerEvents {
@@ -249,7 +249,7 @@ export class StockChart extends Container {
249249
protected _indicatorsChanged = false;
250250
protected _baseDP?: IDisposer;
251251

252-
public _selectionWasOn: boolean = false;
252+
//public _selectionWasOn: boolean = false;
253253

254254
/**
255255
* A list of stock panels.
@@ -418,8 +418,18 @@ export class StockChart extends Container {
418418
}
419419

420420
public _prepareChildren() {
421-
if (this.isDirty("drawingSelectionEnabled") || this.isPrivateDirty("drawingSelectionEnabled")) {
422-
const enabled = this.get("drawingSelectionEnabled", this.getPrivate("drawingSelectionEnabled", false));
421+
if (this.isDirty("drawingSelectionEnabled")) {
422+
const enabled = this.get("drawingSelectionEnabled");
423+
if (enabled !== undefined) {
424+
this._root.events.once("frameended", () => {
425+
this.setPrivate("drawingSelectionEnabled", enabled);
426+
})
427+
}
428+
}
429+
430+
if (this.isPrivateDirty("drawingSelectionEnabled")) {
431+
const enabled = this.getPrivate("drawingSelectionEnabled", false);
432+
423433
if (!enabled) {
424434
this.unselectDrawings();
425435
}
@@ -893,7 +903,7 @@ export class StockChart extends Container {
893903
panelControls.closeButton.setPrivate(visible, false);
894904

895905

896-
if(autoHidePanelControls) {
906+
if (autoHidePanelControls) {
897907
panel.plotContainer.events.on("pointerover", () => {
898908
panelControls.show();
899909
})
@@ -903,7 +913,7 @@ export class StockChart extends Container {
903913
})
904914

905915
panel.plotContainer.events.on("pointerout", () => {
906-
if(!panelControls.isHover()){
916+
if (!panelControls.isHover()) {
907917
panelControls.hide();
908918
}
909919
})

src/.internal/charts/stock/StockChartDefaultTheme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export class StockChartDefaultTheme extends Theme {
4646
strictMinMaxSelection: true
4747
},
4848
autoSetPercentScale: true,
49-
drawingSelectionEnabled: false,
49+
5050
autoHidePanelControls: false
5151
});
5252

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ export class DrawingSeries extends LineSeries {
349349
this._handlePointerOut();
350350
})
351351

352-
this._getStockChart().markDirtyKey("drawingSelectionEnabled");
352+
this._getStockChart()._markDirtyPrivateKey("drawingSelectionEnabled");
353353

354354
}
355355

@@ -507,8 +507,9 @@ export class DrawingSeries extends LineSeries {
507507

508508
public enableDrawingSelection(value: boolean) {
509509
this._erasingEnabled = false;
510-
this.strokes.template.set("forceInactive", !value);
511-
this.fills.template.set("forceInactive", !value);
510+
this._root.events.once("frameended", () => {
511+
this.setInteractive(value);
512+
});
512513
}
513514

514515
protected _showSegmentBullets(index: number) {
@@ -769,7 +770,7 @@ export class DrawingSeries extends LineSeries {
769770
}
770771

771772
if (this._valuesDirty) {
772-
if(!this._baseSeriesDirty){
773+
if (!this._baseSeriesDirty) {
773774
this.markDirtyDrawings();
774775
}
775776
}
@@ -787,7 +788,7 @@ export class DrawingSeries extends LineSeries {
787788
const stockChart = this._getStockChart();
788789
if (stockChart) {
789790
if (value) {
790-
stockChart._selectionWasOn = stockChart.get("drawingSelectionEnabled", false);
791+
//stockChart._selectionWasOn = stockChart.get("drawingSelectionEnabled", false);
791792
stockChart.set("drawingSelectionEnabled", false);
792793
}
793794
}
@@ -857,11 +858,11 @@ export class DrawingSeries extends LineSeries {
857858
protected _dispatchStockEvent(type: any, drawingId?: string, index?: number) {
858859
const stockChart = this._getStockChart();
859860

860-
if (type == "drawingadded") {
861-
if (stockChart._selectionWasOn) {
862-
stockChart.set("drawingSelectionEnabled", true);
863-
}
864-
}
861+
//if (type == "drawingadded") {
862+
//if (stockChart._selectionWasOn) {
863+
// stockChart.set("drawingSelectionEnabled", true);
864+
//}
865+
//}
865866

866867
if (stockChart && stockChart.events.isEnabled(type)) {
867868
stockChart.events.dispatch(type, { drawingId: drawingId, series: this, target: stockChart, index: index });
@@ -1059,15 +1060,15 @@ export class DrawingSeries extends LineSeries {
10591060
}
10601061

10611062
public toggleDrawing(enabled?: boolean) {
1062-
if(this._getStockChart().get("hideDrawingGrips")){
1063+
if (this._getStockChart().get("hideDrawingGrips")) {
10631064
this.circles.getIndex(0)?.markDirty();
10641065
this.root.events.once("frameended", () => {
10651066
this.circles.each((circle) => {
10661067
circle.set("forceHidden", !enabled);
10671068
})
10681069
this.grips.each((grip) => {
10691070
grip.set("forceInactive", !enabled);
1070-
})
1071+
})
10711072
})
10721073
}
10731074
}
@@ -1214,7 +1215,7 @@ export class DrawingSeries extends LineSeries {
12141215

12151216

12161217
public _selectDrawing(index: number, keepSelection?: boolean, force?: boolean) {
1217-
if (this._getStockChart().get("drawingSelectionEnabled") || force) {
1218+
if (this._getStockChart().getPrivate("drawingSelectionEnabled") || force) {
12181219

12191220
this._isSelecting = true;
12201221

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ export class DrawingControl extends StockControl {
675675
stockChart: stockChart,
676676
description: l.translateAny("Select"),
677677
icon: StockIcons.getIcon("Select"),
678-
active: stockChart.get("drawingSelectionEnabled", stockChart.getPrivate("drawingSelectionEnabled", false)),
678+
active: stockChart.get("drawingSelectionEnabled"),
679679
});
680680
this._disposers.push(stockChart.on("drawingSelectionEnabled", (active) => {
681681
selectControl.set("active", active);
@@ -689,7 +689,7 @@ export class DrawingControl extends StockControl {
689689
this.setPrivate("selectControl", selectControl);
690690
selectControl.on("active", (_ev) => {
691691
const active = selectControl.get("active", false);
692-
stockChart.setPrivateRaw("drawingSelectionEnabled", active);
692+
stockChart.setPrivate("drawingSelectionEnabled", active);
693693
});
694694

695695
/**
@@ -859,7 +859,7 @@ export class DrawingControl extends StockControl {
859859
this.getPrivate("eraserControl")!.set("active", false);
860860
}
861861
const stockChart = this.get("stockChart");
862-
stockChart.setPrivate("drawingSelectionEnabled", false)
862+
stockChart.setPrivate("drawingSelectionEnabled", false);
863863
stockChart.unselectDrawings();
864864
return;
865865
}

src/.internal/core/Registry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export class Registry {
66
/**
77
* Currently running version of amCharts.
88
*/
9-
readonly version: string = "5.13.5";
9+
readonly version: string = "5.13.6";
1010

1111
/**
1212
* List of applied licenses.

src/.internal/core/util/DurationFormatter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ export class DurationFormatter extends Entity {
446446
values["day"]++;
447447
values["hour"] = 0;
448448
}
449-
else if (unit == "day" && value == 7) {
449+
else if (unit == "day" && value == 7 && details.parts.indexOf("w") !== -1) {
450450
values["week"]++;
451451
values["day"] = 0;
452452
}

0 commit comments

Comments
 (0)