diff --git a/src/chart/components/chart/chart-area-pan.handler.ts b/src/chart/components/chart/chart-area-pan.handler.ts index 310ca9e..94e89fe 100644 --- a/src/chart/components/chart/chart-area-pan.handler.ts +++ b/src/chart/components/chart/chart-area-pan.handler.ts @@ -1,3 +1,8 @@ +/* + * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ /* * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. @@ -47,8 +52,7 @@ interface ChartPanningOptions { * @param {CanvasBoundsContainer} canvasBoundsContainer - An instance of the CanvasBoundsContainer class. * @param {CanvasAnimation} canvasAnimation - An instance of the CanvasAnimation class. * @param {ChartPanComponent} chartPanComponent - An instance of the ChartPanComponent class. - -*/ + */ export class ChartAreaPanHandler extends ChartBaseElement { private currentPoint: Point = { x: 0, y: 0 }; // number of candles delta changed during X dragging: 1, 5 or -3 for ex. diff --git a/src/chart/components/pane/pane-manager.component.ts b/src/chart/components/pane/pane-manager.component.ts index 9f104e0..d4a5c4e 100644 --- a/src/chart/components/pane/pane-manager.component.ts +++ b/src/chart/components/pane/pane-manager.component.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited + * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ @@ -36,6 +36,16 @@ import { ChartResizeHandler } from '../../inputhandlers/chart-resize.handler'; export type MoveDataSeriesToPaneDirection = 'above' | 'below'; +interface MoveDataSeriesToPaneOptions { + paneUUID?: string; + extent?: YExtentComponent; + direction?: MoveDataSeriesToPaneDirection; + // in some cases pane should not be deleted right after data series move, + // because the next data series could be moved to it + isForceKeepPane?: boolean; + index?: number; +} + export class PaneManager extends ChartBaseElement { public panes: Record = {}; public paneRemovedSubject: Subject = new Subject(); @@ -296,14 +306,9 @@ export class PaneManager extends ChartBaseElement { dataSeries: DataSeriesModel[], initialPane: PaneComponent, initialExtent: YExtentComponent, - paneUUID?: string, - extent?: YExtentComponent, - direction?: MoveDataSeriesToPaneDirection, - // in some cases pane should not be deleted right after data series move, - // because the next data series could be moved to it - forceKeepPane?: boolean, - index = 0, + options: MoveDataSeriesToPaneOptions, ) { + const { paneUUID, extent, direction, isForceKeepPane, index = 0 } = options; const pane = paneUUID && this.panes[paneUUID]; if (!pane) { @@ -314,9 +319,9 @@ export class PaneManager extends ChartBaseElement { initialPane, initialExtent, newPane.mainExtent, - forceKeepPane, + isForceKeepPane, ); - !forceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid); + !isForceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid); return; } @@ -330,7 +335,7 @@ export class PaneManager extends ChartBaseElement { initialExtent.yAxis.state.align, ); } - !forceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid); + !isForceKeepPane && initialPane.yExtentComponents.length === 0 && this.removePane(initialPane.uuid); } /** diff --git a/src/chart/components/pane/pane.component.ts b/src/chart/components/pane/pane.component.ts index d2d4ca2..436c635 100644 --- a/src/chart/components/pane/pane.component.ts +++ b/src/chart/components/pane/pane.component.ts @@ -1,10 +1,5 @@ /* - * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited - * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. - * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. - */ -/* - * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited + * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. */ @@ -302,10 +297,10 @@ export class PaneComponent extends ChartBaseElement { extentComponent: YExtentComponent, // in some cases extent should not be deleted right after data series move, // because the next data series could be moved to it - forceKeepExtent?: boolean, + isForceKeepExtent?: boolean, ) { dataSeries.forEach(series => series.moveToExtent(extentComponent)); - !forceKeepExtent && initialExtent.dataSeries.size === 0 && initialPane.removeExtentComponent(initialExtent); + !isForceKeepExtent && initialExtent.dataSeries.size === 0 && initialPane.removeExtentComponent(initialExtent); this.yExtentComponentsChangedSubject.next(); } diff --git a/src/chart/components/resizer/bar-resizer.component.ts b/src/chart/components/resizer/bar-resizer.component.ts index 74ad02e..0c53f66 100644 --- a/src/chart/components/resizer/bar-resizer.component.ts +++ b/src/chart/components/resizer/bar-resizer.component.ts @@ -1,3 +1,8 @@ +/* + * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ /* * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. diff --git a/src/chart/components/y_axis/price_labels/y-axis-labels.model.ts b/src/chart/components/y_axis/price_labels/y-axis-labels.model.ts index d9bb519..ddafe2f 100644 --- a/src/chart/components/y_axis/price_labels/y-axis-labels.model.ts +++ b/src/chart/components/y_axis/price_labels/y-axis-labels.model.ts @@ -1,3 +1,8 @@ +/* + * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ /* * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. diff --git a/src/chart/components/y_axis/y-axis.component.ts b/src/chart/components/y_axis/y-axis.component.ts index 1c8f2e3..8e42f76 100644 --- a/src/chart/components/y_axis/y-axis.component.ts +++ b/src/chart/components/y_axis/y-axis.component.ts @@ -1,3 +1,8 @@ +/* + * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ /* * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited * 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 { public yAxisScaleHandler: YAxisScaleHandler; public model: YAxisModel; public axisTypeSetSubject: Subject = new Subject(); + public axisAlignSetSubject: Subject = new Subject(); public readonly state: YAxisConfig; constructor( @@ -266,6 +272,7 @@ export class YAxisComponent extends ChartBaseElement { public setYAxisAlign(align: YAxisAlign) { this.state.align = align; this.canvasBoundsContainer.updateYAxisWidths(); + this.axisAlignSetSubject.next(align); this.eventBus.fireDraw(); } diff --git a/src/chart/model/data-series.model.ts b/src/chart/model/data-series.model.ts index d9b38a8..41b0dda 100644 --- a/src/chart/model/data-series.model.ts +++ b/src/chart/model/data-series.model.ts @@ -1,3 +1,8 @@ +/* + * Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited + * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. + * If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/. + */ /* * Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.