Skip to content

Commit ce97db2

Browse files
Keelaro1dxcity
authored and
dxcity
committed
Pull request #5400: Feature/DXCF-5569 web multiple scales syncing for multi chart layouts
Merge in DXCHARTS/dxchart5 from feature/DXCF-5569-web-multiple-scales-syncing-for-multi-chart-layouts to master * commit 'aca4c582a6b2d70025451deda1442114909e9102': [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // pr fix [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // fix standard deviation channel default overlaying value [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // pr fix [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // pr fix [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // pr fix [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // copy [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init [DXCF-5569] [Web] Multiple scales - syncing for multi-chart layouts // init GitOrigin-RevId: d1c1119da85b10b74a8e987752aaa35187c3615b
1 parent 3ac3753 commit ce97db2

7 files changed

+47
-21
lines changed

src/chart/components/chart/chart-area-pan.handler.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
3+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*/
16
/*
27
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
38
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
@@ -47,8 +52,7 @@ interface ChartPanningOptions {
4752
* @param {CanvasBoundsContainer} canvasBoundsContainer - An instance of the CanvasBoundsContainer class.
4853
* @param {CanvasAnimation} canvasAnimation - An instance of the CanvasAnimation class.
4954
* @param {ChartPanComponent} chartPanComponent - An instance of the ChartPanComponent class.
50-
51-
*/
55+
*/
5256
export class ChartAreaPanHandler extends ChartBaseElement {
5357
private currentPoint: Point = { x: 0, y: 0 };
5458
// number of candles delta changed during X dragging: 1, 5 or -3 for ex.

src/chart/components/pane/pane-manager.component.ts

+16-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
2+
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
33
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
44
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
55
*/
@@ -36,6 +36,16 @@ import { ChartResizeHandler } from '../../inputhandlers/chart-resize.handler';
3636

3737
export type MoveDataSeriesToPaneDirection = 'above' | 'below';
3838

39+
interface MoveDataSeriesToPaneOptions {
40+
paneUUID?: string;
41+
extent?: YExtentComponent;
42+
direction?: MoveDataSeriesToPaneDirection;
43+
// in some cases pane should not be deleted right after data series move,
44+
// because the next data series could be moved to it
45+
isForceKeepPane?: boolean;
46+
index?: number;
47+
}
48+
3949
export class PaneManager extends ChartBaseElement {
4050
public panes: Record<string, PaneComponent> = {};
4151
public paneRemovedSubject: Subject<PaneComponent> = new Subject();
@@ -296,14 +306,9 @@ export class PaneManager extends ChartBaseElement {
296306
dataSeries: DataSeriesModel[],
297307
initialPane: PaneComponent,
298308
initialExtent: YExtentComponent,
299-
paneUUID?: string,
300-
extent?: YExtentComponent,
301-
direction?: MoveDataSeriesToPaneDirection,
302-
// in some cases pane should not be deleted right after data series move,
303-
// because the next data series could be moved to it
304-
forceKeepPane?: boolean,
305-
index = 0,
309+
options: MoveDataSeriesToPaneOptions,
306310
) {
311+
const { paneUUID, extent, direction, isForceKeepPane, index = 0 } = options;
307312
const pane = paneUUID && this.panes[paneUUID];
308313

309314
if (!pane) {
@@ -314,9 +319,9 @@ export class PaneManager extends ChartBaseElement {
314319
initialPane,
315320
initialExtent,
316321
newPane.mainExtent,
317-
forceKeepPane,
322+
isForceKeepPane,
318323
);
319-
!forceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
324+
!isForceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
320325
return;
321326
}
322327

@@ -330,7 +335,7 @@ export class PaneManager extends ChartBaseElement {
330335
initialExtent.yAxis.state.align,
331336
);
332337
}
333-
!forceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
338+
!isForceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid);
334339
}
335340

336341
/**

src/chart/components/pane/pane.component.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
/*
2-
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
3-
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4-
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5-
*/
6-
/*
7-
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
2+
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
83
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
94
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
105
*/
@@ -302,10 +297,10 @@ export class PaneComponent extends ChartBaseElement {
302297
extentComponent: YExtentComponent,
303298
// in some cases extent should not be deleted right after data series move,
304299
// because the next data series could be moved to it
305-
forceKeepExtent?: boolean,
300+
isForceKeepExtent?: boolean,
306301
) {
307302
dataSeries.forEach(series => series.moveToExtent(extentComponent));
308-
!forceKeepExtent && initialExtent.dataSeries.size === 0 && initialPane.removeExtentComponent(initialExtent);
303+
!isForceKeepExtent && initialExtent.dataSeries.size === 0 && initialPane.removeExtentComponent(initialExtent);
309304
this.yExtentComponentsChangedSubject.next();
310305
}
311306

src/chart/components/resizer/bar-resizer.component.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
3+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*/
16
/*
27
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
38
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.

src/chart/components/y_axis/price_labels/y-axis-labels.model.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
3+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*/
16
/*
27
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
38
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.

src/chart/components/y_axis/y-axis.component.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
3+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*/
16
/*
27
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
38
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
@@ -57,6 +62,7 @@ export class YAxisComponent extends ChartBaseElement {
5762
public yAxisScaleHandler: YAxisScaleHandler;
5863
public model: YAxisModel;
5964
public axisTypeSetSubject: Subject<PriceAxisType> = new Subject<PriceAxisType>();
65+
public axisAlignSetSubject: Subject<YAxisAlign> = new Subject<YAxisAlign>();
6066
public readonly state: YAxisConfig;
6167

6268
constructor(
@@ -266,6 +272,7 @@ export class YAxisComponent extends ChartBaseElement {
266272
public setYAxisAlign(align: YAxisAlign) {
267273
this.state.align = align;
268274
this.canvasBoundsContainer.updateYAxisWidths();
275+
this.axisAlignSetSubject.next(align);
269276
this.eventBus.fireDraw();
270277
}
271278

src/chart/model/data-series.model.ts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/*
2+
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
3+
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4+
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
5+
*/
16
/*
27
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
38
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.

0 commit comments

Comments
 (0)