@devexperts/dxcharts-lite
Version:
35 lines (34 loc) • 1.48 kB
JavaScript
/*
* Copyright (C) 2019 - 2026 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/.
*/
import { CandleSeriesModel } from './candle-series.model';
/**
* This model represents main chart data series and is highly tied to chartBaseModel, @see ChartBaseModel
*/
export class MainCandleSeriesModel extends CandleSeriesModel {
constructor(baseModel, extentComponent, id, htId, eventBus, scale, instrument, candlesTransformersByChartType, candleWidthByChartType, colors) {
super(extentComponent, id, htId, eventBus, scale, instrument, candlesTransformersByChartType, candleWidthByChartType, colors);
this.baseModel = baseModel;
}
set visualPoints(candles) {
super.visualPoints = candles;
// super.visualPoints will transform 2D array if necessary to 1D array
this.baseModel.mainVisualPoints = super.visualPoints;
}
get visualPoints() {
return super.visualPoints;
}
set dataPoints(candles) {
super.dataPoints = candles;
this.baseModel.mainDataPoints = super.dataPoints;
}
get dataPoints() {
return super.dataPoints;
}
recalculateMeanCandleWidth(visualCandles) {
super.recalculateMeanCandleWidth(visualCandles);
this.baseModel.meanDataWidth = this.meanCandleWidth;
}
}