Skip to content

Commit

Permalink
Pull request #5296: Feature/DXCF-5558 web multiple scales investigate…
Browse files Browse the repository at this point in the history
… current implementation in chart core

Merge in DXCHARTS/dxchart5 from feature/DXCF-5558-web-multiple-scales-investigate-current-implementation-in-chart-core to master

* commit '14aab3f12998d78bb90a3af995e122995de9e282':
  [DXCF-5558] [Web] Multiple scales - investigate current implementation in chart-core // pr fix
  [DXCF-5558] [Web] Multiple scales - investigate current implementation in chart-core // init
  [DXCF-5558] [Web] Multiple scales - investigate current implementation in chart-core // init
  [DXCF-5558] [Web] Multiple scales - investigate current implementation in chart-core // init
  [DXCF-5558] [Web] Multiple scales - investigate current implementation in chart-core // init
  [DXCF-5558] [Web] Multiple scales - investigate current implementation in chart-core // init
  [DXCF-5558] [Web] Multiple scales - investigate current implementation in chart-core // init

GitOrigin-RevId: 4eb1f711c04a739705e8f334ccd9857c6bda046e
  • Loading branch information
Keelaro1 authored and dxcity committed Nov 19, 2024
1 parent 12cebc9 commit 8e72139
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/chart/components/pane/pane-manager.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,20 @@ export class PaneManager extends ChartBaseElement {
this.recalculateState();
}

/**
* Moves data series to a certain pane, or creates a new one if no pane is found
*/
public moveDataSeriesToPane(dataSeries: DataSeriesModel, paneUUID?: string) {
const initialPane = dataSeries.extentComponent.paneComponent;

const pane = paneUUID && this.panes[paneUUID] ? this.panes[paneUUID] : this.createPane();
pane.moveDataSeriesToExistingExtentComponent(dataSeries, pane.mainExtent);

if (initialPane.yExtentComponents.length === 0) {
this.removePane(initialPane.uuid);
}
}

/**
* Adds cursors to the chart elements based on the provided uuid and cursor type.
* @private
Expand Down
19 changes: 18 additions & 1 deletion src/chart/components/pane/pane.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
HitBoundsTest,
} from '../../canvas/canvas-bounds-container';
import { CursorHandler } from '../../canvas/cursor.handler';
import { FullChartConfig, YAxisConfig } from '../../chart.config';
import { FullChartConfig, YAxisAlign, YAxisConfig } from '../../chart.config';
import { DrawingManager } from '../../drawers/drawing-manager';
import EventBus from '../../events/event-bus';
import { CanvasInputListenerComponent } from '../../inputlisteners/canvas-input-listener.component';
Expand Down Expand Up @@ -267,6 +267,23 @@ export class PaneComponent extends ChartBaseElement {
this.canvasBoundsContainer.updateYAxisWidths();
}

public moveDataSeriesToNewExtentComponent(dataSeries: DataSeriesModel, align: YAxisAlign = 'right') {
const extent = this.createExtentComponent();
extent.yAxis.setYAxisAlign(align);
dataSeries.moveToExtent(extent);
}

public moveDataSeriesToExistingExtentComponent(dataSeries: DataSeriesModel, extentComponent: YExtentComponent) {
const initialPane = dataSeries.extentComponent.paneComponent;
const initialExtent = dataSeries.extentComponent;
dataSeries.moveToExtent(extentComponent);

const initialExtentDataSeriesSize = initialExtent.dataSeries.size;
if (initialExtentDataSeriesSize === 0) {
initialPane.removeExtentComponent(initialExtent);
}
}

/**
* This method updates the view by calling the doAutoScale method of the scaleModel and firing the Draw event using the eventBus.
* @private
Expand Down

0 comments on commit 8e72139

Please sign in to comment.