diff --git a/src/chart/components/volumes/volumes.component.ts b/src/chart/components/volumes/volumes.component.ts index d9d7e4be..bf81cdee 100644 --- a/src/chart/components/volumes/volumes.component.ts +++ b/src/chart/components/volumes/volumes.component.ts @@ -17,16 +17,15 @@ import { PaneManager } from '../pane/pane-manager.component'; import { SeparateVolumesComponent } from './separate-volumes.component'; import { resolveColorForBar, resolveColorForCandle, resolveColorForLine } from './volume-color-resolvers.functions'; import { VolumesDrawer } from './volumes.drawer'; -import { VolumesModel } from './volumes.model'; +import { VOLUMES_UUID, VolumesModel } from './volumes.model'; export type VolumeColorResolver = (priceMovement: PriceMovement, colors: FullChartColors) => string; export class VolumesComponent extends ChartBaseElement { separateVolumes: SeparateVolumesComponent; - dynamicObjectsComponent: DynamicObjectsComponent; public volumesColorByChartTypeMap: Partial> = {}; volumesModel: VolumesModel; - volumesDrawer: VolumesDrawer + private readonly volumesDrawer: VolumesDrawer; public volumeVisibilityChangedSubject = new BehaviorSubject(false); public volumeIsSeparateModeChangedSubject = new BehaviorSubject(false); @@ -38,7 +37,7 @@ export class VolumesComponent extends ChartBaseElement { drawingManager: DrawingManager, private config: FullChartConfig, paneManager: PaneManager, - dynamicObjectsComponent: DynamicObjectsComponent, + private dynamicObjectsComponent: DynamicObjectsComponent, ) { super(); const volumesModel = new VolumesModel(chartComponent, scale); @@ -51,7 +50,6 @@ export class VolumesComponent extends ChartBaseElement { volumesModel, paneManager, ); - this.dynamicObjectsComponent = dynamicObjectsComponent; this.volumesDrawer = new VolumesDrawer( config, this.volumesModel, @@ -140,7 +138,7 @@ export class VolumesComponent extends ChartBaseElement { private addVolumesToDynamicObjects() { this.dynamicObjectsComponent.model.addObject({ id: this.volumesModel.id, - paneId: this.config.components.volumes.showSeparately ? this.volumesModel.id : CHART_UUID, + paneId: this.config.components.volumes.showSeparately ? VOLUMES_UUID : CHART_UUID, drawer: this.volumesDrawer, model: this.volumesModel, }); diff --git a/src/chart/components/volumes/volumes.model.ts b/src/chart/components/volumes/volumes.model.ts index 0fed4aa2..2e2238ab 100644 --- a/src/chart/components/volumes/volumes.model.ts +++ b/src/chart/components/volumes/volumes.model.ts @@ -14,7 +14,7 @@ import { firstOf, maxMin } from '../../utils/array.utils'; const volumeMaxMinFn = maxMin(candle => candle.candle.volume); -const VOLUMES_UUID = 'volumes'; +export const VOLUMES_UUID = 'volumes'; export class VolumesModel extends ChartBaseElement { public readonly id = VOLUMES_UUID; // max volume in all data series