@devexperts/dxcharts-lite 2.7.9 → 2.7.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chart/canvas/canvas-bounds-container.js +0 -5
- package/dist/chart/chart.config.d.ts +7 -0
- package/dist/chart/chart.config.js +3 -0
- package/dist/chart/chart.d.ts +5 -1
- package/dist/chart/chart.js +12 -0
- package/dist/chart/components/chart/chart-area-pan.handler.js +0 -5
- package/dist/chart/components/chart/chart-base.model.d.ts +4 -1
- package/dist/chart/components/chart/chart-base.model.js +2 -2
- package/dist/chart/components/chart/chart.model.d.ts +4 -1
- package/dist/chart/components/chart/chart.model.js +6 -6
- package/dist/chart/components/chart/{price.formatter.d.ts → price-formatters/price.formatter.d.ts} +7 -6
- package/dist/chart/components/chart/{price.formatter.js → price-formatters/price.formatter.js} +10 -5
- package/dist/chart/components/chart/price-formatters/treasury-price.formatter.d.ts +17 -0
- package/dist/chart/components/chart/price-formatters/treasury-price.formatter.js +27 -0
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.d.ts +4 -1
- package/dist/chart/components/labels_generator/numeric-axis-labels.generator.js +8 -2
- package/dist/chart/components/navigation_map/navigation-map-move.handler.d.ts +8 -7
- package/dist/chart/components/pane/extent/y-extent-component.d.ts +2 -1
- package/dist/chart/components/pane/extent/y-extent-component.js +4 -8
- package/dist/chart/components/pane/pane.component.d.ts +1 -1
- package/dist/chart/components/pane/pane.component.js +2 -7
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.d.ts +3 -1
- package/dist/chart/components/y_axis/numeric-y-axis-labels.generator.js +9 -4
- package/dist/chart/components/y_axis/y-axis.model.js +1 -1
- package/dist/chart/model/data-series.model.d.ts +4 -4
- package/dist/chart/model/data-series.model.js +3 -2
- package/dist/chart/utils/candles.utils.d.ts +5 -1
- package/dist/chart/utils/candles.utils.js +14 -4
- package/dist/dxchart.min.js +4 -4
- package/package.json +1 -1
|
@@ -1,8 +1,3 @@
|
|
|
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
|
-
*/
|
|
6
1
|
/*
|
|
7
2
|
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
|
|
8
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
@@ -442,6 +442,10 @@ export interface YAxisConfig {
|
|
|
442
442
|
};
|
|
443
443
|
fontSize: number;
|
|
444
444
|
fontFamily: string;
|
|
445
|
+
/**
|
|
446
|
+
* Treasury format for price values (1/32 tick format for bonds)
|
|
447
|
+
*/
|
|
448
|
+
treasuryFormat?: YAxisConfigTreasuryFormat;
|
|
445
449
|
}
|
|
446
450
|
export interface ChartConfigComponentsOffsets {
|
|
447
451
|
visible: boolean;
|
|
@@ -788,6 +792,9 @@ export interface YAxisLabels {
|
|
|
788
792
|
*/
|
|
789
793
|
settings: Record<YAxisLabelType, YAxisLabelConfig>;
|
|
790
794
|
}
|
|
795
|
+
export interface YAxisConfigTreasuryFormat {
|
|
796
|
+
enabled: boolean;
|
|
797
|
+
}
|
|
791
798
|
export interface YAxisTypeConfigProps {
|
|
792
799
|
rounded?: boolean;
|
|
793
800
|
paddings?: {
|
package/dist/chart/chart.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
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
5
|
*/
|
|
6
6
|
import ChartBootstrap from './bootstrap';
|
|
7
|
-
import { BarType, PartialChartConfig } from './chart.config';
|
|
7
|
+
import { BarType, PartialChartConfig, YAxisConfigTreasuryFormat } from './chart.config';
|
|
8
8
|
import { CandleSeries } from './components/chart/chart.component';
|
|
9
9
|
import { PaneComponent, YExtentFormatters } from './components/pane/pane.component';
|
|
10
10
|
/**
|
|
@@ -60,5 +60,9 @@ export declare class Chart extends ChartBootstrap {
|
|
|
60
60
|
*/
|
|
61
61
|
setRtl(rtl: boolean): void;
|
|
62
62
|
setChartType(type: BarType): void;
|
|
63
|
+
/**
|
|
64
|
+
* Sets if regular or logarithmic price types should apply treasury format
|
|
65
|
+
*/
|
|
66
|
+
setTreasuryFormat(treasuryFormat: YAxisConfigTreasuryFormat): void;
|
|
63
67
|
createPane(): PaneComponent;
|
|
64
68
|
}
|
package/dist/chart/chart.js
CHANGED
|
@@ -103,6 +103,18 @@ export class Chart extends ChartBootstrap {
|
|
|
103
103
|
this.data.setChartType(type);
|
|
104
104
|
this.yAxis.updateOrderedLabels();
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Sets if regular or logarithmic price types should apply treasury format
|
|
108
|
+
*/
|
|
109
|
+
setTreasuryFormat(treasuryFormat) {
|
|
110
|
+
this.config.components.yAxis.treasuryFormat = treasuryFormat;
|
|
111
|
+
this.paneManager.yExtents.forEach(ext => {
|
|
112
|
+
ext.yAxis.model.labelsGenerator.updateTreasuryFormat(treasuryFormat);
|
|
113
|
+
ext.yAxis.model.labelsGenerator.doGenerateLabels();
|
|
114
|
+
ext.yAxis.model.fancyLabelsModel.updateLabels(true);
|
|
115
|
+
ext.yAxis.model.baseLabelsModel.updateLabels();
|
|
116
|
+
});
|
|
117
|
+
}
|
|
106
118
|
createPane() {
|
|
107
119
|
return this.paneManager.createPane();
|
|
108
120
|
}
|
|
@@ -3,11 +3,6 @@
|
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
-
/*
|
|
7
|
-
* Copyright (C) 2019 - 2024 Devexperts Solutions IE Limited
|
|
8
|
-
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
9
|
-
* If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
10
|
-
*/
|
|
11
6
|
import { animationFrameScheduler } from 'rxjs';
|
|
12
7
|
import { throttleTime, filter } from 'rxjs/operators';
|
|
13
8
|
import { VIEWPORT_ANIMATION_ID } from '../../animation/canvas-animation';
|
|
@@ -40,7 +40,10 @@ export declare class ChartBaseModel<T extends BaseType = 'point'> {
|
|
|
40
40
|
* For given timestamp finds the closest candle in dataset.
|
|
41
41
|
* @param timestamp
|
|
42
42
|
*/
|
|
43
|
-
dataFromTimestamp(timestamp: Timestamp,
|
|
43
|
+
dataFromTimestamp(timestamp: Timestamp, options?: {
|
|
44
|
+
extrapolate: boolean;
|
|
45
|
+
isDaysPeriod?: boolean;
|
|
46
|
+
}, selectedDataPoints?: DataPoint<T>[]): VisualPoint<T>;
|
|
44
47
|
/**
|
|
45
48
|
* Recalculates the period of the main candle series based on the data points.
|
|
46
49
|
* If a period is detected, it is set as the new period.
|
|
@@ -34,8 +34,8 @@ export class ChartBaseModel {
|
|
|
34
34
|
* @param timestamp
|
|
35
35
|
*/
|
|
36
36
|
// TODO think how to make this function like candleFromX
|
|
37
|
-
dataFromTimestamp(timestamp,
|
|
38
|
-
const result = searchCandleIndex(timestamp,
|
|
37
|
+
dataFromTimestamp(timestamp, options = { extrapolate: true }, selectedDataPoints = this.mainDataPoints) {
|
|
38
|
+
const result = searchCandleIndex(timestamp, options, selectedDataPoints, this.period);
|
|
39
39
|
return this.dataFromIdx(result.index);
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -227,7 +227,10 @@ export declare class ChartModel extends ChartBaseElement {
|
|
|
227
227
|
* For given timestamp finds the closest candle in dataset.
|
|
228
228
|
* @param timestamp
|
|
229
229
|
*/
|
|
230
|
-
candleFromTimestamp(timestamp: Timestamp,
|
|
230
|
+
candleFromTimestamp(timestamp: Timestamp, options?: {
|
|
231
|
+
extrapolate: boolean;
|
|
232
|
+
isDaysPeriod?: boolean;
|
|
233
|
+
}, selectedCandleSeries?: CandleSeriesModel): VisualCandle;
|
|
231
234
|
/**
|
|
232
235
|
* For given id finds the target candle
|
|
233
236
|
* @param id
|
|
@@ -524,9 +524,9 @@ export class ChartModel extends ChartBaseElement {
|
|
|
524
524
|
* For given timestamp finds the closest candle in dataset.
|
|
525
525
|
* @param timestamp
|
|
526
526
|
*/
|
|
527
|
-
candleFromTimestamp(timestamp,
|
|
527
|
+
candleFromTimestamp(timestamp, options = { extrapolate: true }, selectedCandleSeries = this.mainCandleSeries) {
|
|
528
528
|
const dataPointsSource = selectedCandleSeries.dataPoints;
|
|
529
|
-
return this.chartBaseModel.dataFromTimestamp(timestamp,
|
|
529
|
+
return this.chartBaseModel.dataFromTimestamp(timestamp, options, dataPointsSource);
|
|
530
530
|
}
|
|
531
531
|
/**
|
|
532
532
|
* For given id finds the target candle
|
|
@@ -723,7 +723,7 @@ export class ChartModel extends ChartBaseElement {
|
|
|
723
723
|
return series.reduce((candles, candle) => {
|
|
724
724
|
const timestamp = candle.timestamp;
|
|
725
725
|
// find index of candle in baseSeries
|
|
726
|
-
const result = searchCandleIndex(timestamp, false, baseSeries, this.chartBaseModel.period);
|
|
726
|
+
const result = searchCandleIndex(timestamp, { extrapolate: false }, baseSeries, this.chartBaseModel.period);
|
|
727
727
|
if (result.index >= 0 && result.index < baseSeries.length) {
|
|
728
728
|
candle.idx = result.index;
|
|
729
729
|
candles[result.index] = candle;
|
|
@@ -767,7 +767,7 @@ export class ChartModel extends ChartBaseElement {
|
|
|
767
767
|
return;
|
|
768
768
|
}
|
|
769
769
|
// detect index of updating candle
|
|
770
|
-
const result = searchCandleIndex(candle.timestamp, true, curCandles, this.getPeriod());
|
|
770
|
+
const result = searchCandleIndex(candle.timestamp, { extrapolate: true }, curCandles, this.getPeriod());
|
|
771
771
|
const idx = Math.min(result.index, curCandles.length);
|
|
772
772
|
isNewCandle = isNewCandle || idx === curCandles.length;
|
|
773
773
|
// update the candle and index
|
|
@@ -873,7 +873,7 @@ export class ChartModel extends ChartBaseElement {
|
|
|
873
873
|
const targetCopy = target.slice();
|
|
874
874
|
const prepend = [];
|
|
875
875
|
prependUpdate.forEach(c => {
|
|
876
|
-
const result = searchCandleIndex(c.timestamp, false, target);
|
|
876
|
+
const result = searchCandleIndex(c.timestamp, { extrapolate: false }, target);
|
|
877
877
|
const idx = result.index;
|
|
878
878
|
if (idx < 0) {
|
|
879
879
|
prepend.push(c);
|
|
@@ -1007,7 +1007,7 @@ const updateCandles = (target, update) => {
|
|
|
1007
1007
|
const prepend = [];
|
|
1008
1008
|
const append = [];
|
|
1009
1009
|
update.forEach(c => {
|
|
1010
|
-
const result = searchCandleIndex(c.timestamp, true, target);
|
|
1010
|
+
const result = searchCandleIndex(c.timestamp, { extrapolate: true }, target);
|
|
1011
1011
|
const idx = result.index;
|
|
1012
1012
|
if (idx < 0) {
|
|
1013
1013
|
prepend.push(c);
|
package/dist/chart/components/chart/{price.formatter.d.ts → price-formatters/price.formatter.d.ts}
RENAMED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
6
|
+
import { YAxisConfig } from '../../../chart.config';
|
|
7
|
+
import { DataSeriesModel } from '../../../model/data-series.model';
|
|
8
|
+
import { Unit } from '../../../model/scaling/viewport.model';
|
|
9
|
+
import { YExtentComponent } from '../../pane/extent/y-extent-component';
|
|
10
|
+
import { YExtentFormatters } from '../../pane/pane.component';
|
|
11
|
+
export declare const createRegularPriceFormatter: (extent: YExtentComponent, config: YAxisConfig) => (value: unknown) => string;
|
|
11
12
|
export declare const createPercentFormatter: (extent: YExtentComponent) => (value: Unit, dataSeries?: DataSeriesModel) => string;
|
|
12
|
-
export declare const createYExtentFormatters: (extent: YExtentComponent) => YExtentFormatters;
|
|
13
|
+
export declare const createYExtentFormatters: (extent: YExtentComponent, config: YAxisConfig) => YExtentFormatters;
|
package/dist/chart/components/chart/{price.formatter.js → price-formatters/price.formatter.js}
RENAMED
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
-
import { unitToPercent } from '
|
|
7
|
-
import { PriceIncrementsUtils } from '
|
|
8
|
-
|
|
6
|
+
import { unitToPercent } from '../../../model/scaling/viewport.model';
|
|
7
|
+
import { PriceIncrementsUtils } from '../../../utils/price-increments.utils';
|
|
8
|
+
import { treasuryPriceFormatter } from './treasury-price.formatter';
|
|
9
|
+
export const createRegularPriceFormatter = (extent, config) => (value) => {
|
|
9
10
|
let checkedValue;
|
|
10
11
|
if (typeof value === 'number') {
|
|
11
12
|
checkedValue = value;
|
|
@@ -16,6 +17,10 @@ export const createRegularPriceFormatter = (extent) => (value) => {
|
|
|
16
17
|
else {
|
|
17
18
|
return '—';
|
|
18
19
|
}
|
|
20
|
+
const treasuryFormatConfig = config.treasuryFormat;
|
|
21
|
+
if (treasuryFormatConfig && treasuryFormatConfig.enabled) {
|
|
22
|
+
return treasuryPriceFormatter(checkedValue);
|
|
23
|
+
}
|
|
19
24
|
const [mainDataSeries] = extent.dataSeries;
|
|
20
25
|
if (mainDataSeries !== undefined) {
|
|
21
26
|
const precision = PriceIncrementsUtils.getPricePrecision(checkedValue, mainDataSeries.pricePrecisions);
|
|
@@ -34,7 +39,7 @@ export const createPercentFormatter = (extent) => (value, dataSeries) => {
|
|
|
34
39
|
const formatted = valueUnit.toFixed(PriceIncrementsUtils.DEFAULT_PRECISION).replace('-', '−') + ' %';
|
|
35
40
|
return formatted === '−0.00 %' ? '0.00 %' : formatted;
|
|
36
41
|
};
|
|
37
|
-
export const createYExtentFormatters = (extent) => ({
|
|
42
|
+
export const createYExtentFormatters = (extent, config) => ({
|
|
38
43
|
percent: createPercentFormatter(extent),
|
|
39
|
-
regular: createRegularPriceFormatter(extent),
|
|
44
|
+
regular: createRegularPriceFormatter(extent, config),
|
|
40
45
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Formats price values for US Treasury contracts in 32nds format
|
|
8
|
+
*
|
|
9
|
+
* Examples:
|
|
10
|
+
*
|
|
11
|
+
* 132.015625 => 132'00 (0.015625 = 0.5/32)
|
|
12
|
+
* 132.0625 => 132'02 (0.0625 = 2/32)
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare const TREASURY_32ND: number;
|
|
16
|
+
export declare const treasuryPriceFormatter: (value: number) => string;
|
|
17
|
+
export declare const isTreasuryPriceFormat: (value: string) => boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Formats price values for US Treasury contracts in 32nds format
|
|
8
|
+
*
|
|
9
|
+
* Examples:
|
|
10
|
+
*
|
|
11
|
+
* 132.015625 => 132'00 (0.015625 = 0.5/32)
|
|
12
|
+
* 132.0625 => 132'02 (0.0625 = 2/32)
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export const TREASURY_32ND = 1 / 32; // 0.03125
|
|
16
|
+
export const treasuryPriceFormatter = (value) => {
|
|
17
|
+
const integerValue = Math.floor(value);
|
|
18
|
+
// Get the decimal part and convert to 64ths
|
|
19
|
+
const decimalPart = value - integerValue;
|
|
20
|
+
const sixtyFourths = Math.round(decimalPart * 64);
|
|
21
|
+
// Calculate 32nds and half
|
|
22
|
+
const thirtySeconds = Math.floor(sixtyFourths / 2);
|
|
23
|
+
// Format the 32nds part to always show 2 digits (00-31)
|
|
24
|
+
const thirtySecondsFormatted = thirtySeconds.toString().padStart(2, '0');
|
|
25
|
+
return `${integerValue}'${thirtySecondsFormatted}`;
|
|
26
|
+
};
|
|
27
|
+
export const isTreasuryPriceFormat = (value) => Boolean(value.match(/^\-?0*(\d+)'(\d{2})$/));
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { Observable, Subject } from 'rxjs';
|
|
7
7
|
import { Unit } from '../../model/scaling/viewport.model';
|
|
8
8
|
import { AnimationFrameCache } from '../../utils/performance/animation-frame-cache.utils';
|
|
9
|
+
import { YAxisConfig, YAxisConfigTreasuryFormat } from '../../chart.config';
|
|
9
10
|
export type PriceAxisType = 'regular' | 'percent' | 'logarithmic';
|
|
10
11
|
export interface LabelsGenerator {
|
|
11
12
|
readonly observeLabelsChanged: () => Observable<NumericAxisLabel[]>;
|
|
@@ -23,6 +24,7 @@ export declare class NumericAxisLabelsGenerator implements LabelsGenerator {
|
|
|
23
24
|
private baseLineProvider;
|
|
24
25
|
private labelFilter;
|
|
25
26
|
private singleLabelHeightPixels;
|
|
27
|
+
private yAxisConfig?;
|
|
26
28
|
/**
|
|
27
29
|
* Multipliers which are using for price increments to
|
|
28
30
|
* calculate horizontal grid and price lines step.
|
|
@@ -34,7 +36,8 @@ export declare class NumericAxisLabelsGenerator implements LabelsGenerator {
|
|
|
34
36
|
newGeneratedLabelsSubject: Subject<NumericAxisLabel[]>;
|
|
35
37
|
private lastStart;
|
|
36
38
|
private lastEnd;
|
|
37
|
-
|
|
39
|
+
protected treasuryFormat: YAxisConfigTreasuryFormat | undefined;
|
|
40
|
+
constructor(increment: number | null, startEndProvider: () => [Unit, Unit], lengthProvider: () => Unit, valueFormatter: (value: number) => string, withZero: boolean, axisTypeProvider: () => PriceAxisType, baseLineProvider: () => number, labelFilter?: (labels: NumericAxisLabel[]) => NumericAxisLabel[], singleLabelHeightPixels?: number, yAxisConfig?: YAxisConfig | undefined);
|
|
38
41
|
private generateRegularLabels;
|
|
39
42
|
private generatePercentLabels;
|
|
40
43
|
private generateLogarithmLabels;
|
|
@@ -9,13 +9,14 @@ import { AnimationFrameCache } from '../../utils/performance/animation-frame-cac
|
|
|
9
9
|
import { identity } from '../../utils/function.utils';
|
|
10
10
|
import { MathUtils } from '../../utils/math.utils';
|
|
11
11
|
import { PriceIncrementsUtils } from '../../utils/price-increments.utils';
|
|
12
|
+
import { TREASURY_32ND } from '../chart/price-formatters/treasury-price.formatter';
|
|
12
13
|
const PIXEL_OFFSET = 0;
|
|
13
14
|
const DEFAULT_REGULAR_INCREMENT = 0.01;
|
|
14
15
|
/**
|
|
15
16
|
* Generator of axes labels.
|
|
16
17
|
*/
|
|
17
18
|
export class NumericAxisLabelsGenerator {
|
|
18
|
-
constructor(increment, startEndProvider, lengthProvider, valueFormatter, withZero = false, axisTypeProvider, baseLineProvider, labelFilter = identity, singleLabelHeightPixels = 23) {
|
|
19
|
+
constructor(increment, startEndProvider, lengthProvider, valueFormatter, withZero = false, axisTypeProvider, baseLineProvider, labelFilter = identity, singleLabelHeightPixels = 23, yAxisConfig) {
|
|
19
20
|
this.increment = increment;
|
|
20
21
|
this.startEndProvider = startEndProvider;
|
|
21
22
|
this.lengthProvider = lengthProvider;
|
|
@@ -25,6 +26,7 @@ export class NumericAxisLabelsGenerator {
|
|
|
25
26
|
this.baseLineProvider = baseLineProvider;
|
|
26
27
|
this.labelFilter = labelFilter;
|
|
27
28
|
this.singleLabelHeightPixels = singleLabelHeightPixels;
|
|
29
|
+
this.yAxisConfig = yAxisConfig;
|
|
28
30
|
/**
|
|
29
31
|
* Multipliers which are using for price increments to
|
|
30
32
|
* calculate horizontal grid and price lines step.
|
|
@@ -38,6 +40,7 @@ export class NumericAxisLabelsGenerator {
|
|
|
38
40
|
this.lastStart = 0;
|
|
39
41
|
this.lastEnd = 0;
|
|
40
42
|
this.labelsCache = new AnimationFrameCache(() => this.labelFilter(this.doGenerateLabels()));
|
|
43
|
+
this.treasuryFormat = this.yAxisConfig && this.yAxisConfig.treasuryFormat;
|
|
41
44
|
}
|
|
42
45
|
generateRegularLabels(min, max, singleLabelHeightValue) {
|
|
43
46
|
const newLabels = [];
|
|
@@ -136,13 +139,16 @@ export class NumericAxisLabelsGenerator {
|
|
|
136
139
|
return this.newGeneratedLabelsSubject.asObservable();
|
|
137
140
|
}
|
|
138
141
|
calculateIncrement(valueLength) {
|
|
142
|
+
var _a;
|
|
139
143
|
// provided increment
|
|
140
144
|
if (this.increment) {
|
|
141
145
|
return this.increment;
|
|
142
146
|
}
|
|
143
147
|
// auto-generated increment
|
|
144
148
|
if (!isNaN(valueLength)) {
|
|
145
|
-
const calculatedIncrement =
|
|
149
|
+
const calculatedIncrement = ((_a = this.treasuryFormat) === null || _a === void 0 ? void 0 : _a.enabled)
|
|
150
|
+
? TREASURY_32ND
|
|
151
|
+
: PriceIncrementsUtils.autoDetectIncrementOfValueRange(valueLength);
|
|
146
152
|
return this.adjustIncrementOnAxisType(calculatedIncrement);
|
|
147
153
|
}
|
|
148
154
|
return this.adjustIncrementOnAxisType(DEFAULT_REGULAR_INCREMENT);
|
|
@@ -6,9 +6,10 @@
|
|
|
6
6
|
import { CanvasBoundsContainer } from '../../canvas/canvas-bounds-container';
|
|
7
7
|
import EventBus from '../../events/event-bus';
|
|
8
8
|
import { ChartBaseElement } from '../../model/chart-base-element';
|
|
9
|
-
import { CanvasInputListenerComponent } from '../../inputlisteners/canvas-input-listener.component';
|
|
9
|
+
import { CanvasInputListenerComponent, Point } from '../../inputlisteners/canvas-input-listener.component';
|
|
10
10
|
import { ScaleModel } from '../../model/scale.model';
|
|
11
11
|
import { ChartModel } from '../chart/chart.model';
|
|
12
|
+
import { DragInfo } from '../dran-n-drop_helper/drag-n-drop.component';
|
|
12
13
|
import { ChartPanComponent } from '../pan/chart-pan.component';
|
|
13
14
|
export declare class NavigationMapMoveHandler extends ChartBaseElement {
|
|
14
15
|
private bus;
|
|
@@ -17,8 +18,8 @@ export declare class NavigationMapMoveHandler extends ChartBaseElement {
|
|
|
17
18
|
private canvasInputListeners;
|
|
18
19
|
private canvasBoundsContainer;
|
|
19
20
|
private chartPanComponent;
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
leftKnotDragStartXRelative: number;
|
|
22
|
+
rightKnotDragStartXRelative: number;
|
|
22
23
|
private lastMousePosition;
|
|
23
24
|
constructor(bus: EventBus, chartModel: ChartModel, scale: ScaleModel, canvasInputListeners: CanvasInputListenerComponent, canvasBoundsContainer: CanvasBoundsContainer, chartPanComponent: ChartPanComponent);
|
|
24
25
|
/**
|
|
@@ -27,10 +28,10 @@ export declare class NavigationMapMoveHandler extends ChartBaseElement {
|
|
|
27
28
|
* @returns {void}
|
|
28
29
|
*/
|
|
29
30
|
protected doActivate(): void;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
leftKnotDragStart: (point: Point) => void;
|
|
32
|
+
leftKnotDragTick: (dragInfo: DragInfo) => void;
|
|
33
|
+
rightKnotDragStart: (point: Point) => void;
|
|
34
|
+
rightKnotDragTick: (dragInfo: DragInfo) => void;
|
|
34
35
|
private sliderDragStart;
|
|
35
36
|
private sliderDragTick;
|
|
36
37
|
}
|
|
@@ -29,6 +29,7 @@ export interface YExtentCreationOptions {
|
|
|
29
29
|
lockToPriceRatio: boolean;
|
|
30
30
|
}
|
|
31
31
|
export declare class YExtentComponent extends ChartBaseElement {
|
|
32
|
+
config: YAxisConfig;
|
|
32
33
|
paneUUID: string;
|
|
33
34
|
idx: number;
|
|
34
35
|
paneComponent: PaneComponent;
|
|
@@ -42,7 +43,7 @@ export declare class YExtentComponent extends ChartBaseElement {
|
|
|
42
43
|
formatters: YExtentFormatters;
|
|
43
44
|
yAxis: YAxisComponent;
|
|
44
45
|
mainDataSeries?: DataSeriesModel;
|
|
45
|
-
constructor(paneUUID: string, idx: number, paneComponent: PaneComponent, chartBaseModel: ChartBaseModel<'candle'>, canvasBoundsContainer: CanvasBoundsContainer, hitTestController: PaneHitTestController, dynamicObjectsCanvasModel: CanvasModel, scale: ScaleModel, createYAxisComponent: (formatter: (value: number) => string, dataSeriesProvider: () => DataSeriesModel | undefined) => YAxisComponent, dragNDrop: DragNDropYComponent, dataSeries?: Set<DataSeriesModel>, formatters?: YExtentFormatters);
|
|
46
|
+
constructor(config: YAxisConfig, paneUUID: string, idx: number, paneComponent: PaneComponent, chartBaseModel: ChartBaseModel<'candle'>, canvasBoundsContainer: CanvasBoundsContainer, hitTestController: PaneHitTestController, dynamicObjectsCanvasModel: CanvasModel, scale: ScaleModel, createYAxisComponent: (formatter: (value: number) => string, dataSeriesProvider: () => DataSeriesModel | undefined) => YAxisComponent, dragNDrop: DragNDropYComponent, dataSeries?: Set<DataSeriesModel>, formatters?: YExtentFormatters);
|
|
46
47
|
protected doDeactivate(): void;
|
|
47
48
|
getYAxisBounds: () => Bounds;
|
|
48
49
|
yAxisHT: import("../../../canvas/canvas-bounds-container").HitBoundsTest;
|
|
@@ -1,8 +1,3 @@
|
|
|
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
|
-
*/
|
|
6
1
|
/*
|
|
7
2
|
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
|
|
8
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
@@ -13,12 +8,13 @@ import { ChartBaseElement } from '../../../model/chart-base-element';
|
|
|
13
8
|
import { DataSeriesModel, VisualSeriesPoint, defaultValueFormatter, } from '../../../model/data-series.model';
|
|
14
9
|
import { mergeHighLow } from '../../../model/scaling/auto-scale.model';
|
|
15
10
|
import { uuid } from '../../../utils/uuid.utils';
|
|
16
|
-
import { createYExtentFormatters } from '../../chart/price.formatter';
|
|
11
|
+
import { createYExtentFormatters } from '../../chart/price-formatters/price.formatter';
|
|
17
12
|
export class YExtentComponent extends ChartBaseElement {
|
|
18
|
-
constructor(paneUUID, idx, paneComponent, chartBaseModel, canvasBoundsContainer, hitTestController, dynamicObjectsCanvasModel, scale, createYAxisComponent, dragNDrop, dataSeries = new Set(), formatters = {
|
|
13
|
+
constructor(config, paneUUID, idx, paneComponent, chartBaseModel, canvasBoundsContainer, hitTestController, dynamicObjectsCanvasModel, scale, createYAxisComponent, dragNDrop, dataSeries = new Set(), formatters = {
|
|
19
14
|
regular: defaultValueFormatter,
|
|
20
15
|
}) {
|
|
21
16
|
super();
|
|
17
|
+
this.config = config;
|
|
22
18
|
this.paneUUID = paneUUID;
|
|
23
19
|
this.idx = idx;
|
|
24
20
|
this.paneComponent = paneComponent;
|
|
@@ -56,7 +52,7 @@ export class YExtentComponent extends ChartBaseElement {
|
|
|
56
52
|
}
|
|
57
53
|
};
|
|
58
54
|
this.addChildEntity(scale);
|
|
59
|
-
this.setValueFormatters(createYExtentFormatters(this));
|
|
55
|
+
this.setValueFormatters(createYExtentFormatters(this, config));
|
|
60
56
|
this.yAxis = createYAxisComponent(this.valueFormatter.bind(this), () => this.mainDataSeries);
|
|
61
57
|
this.addChildEntity(this.yAxis);
|
|
62
58
|
}
|
|
@@ -54,7 +54,7 @@ export declare class PaneComponent extends ChartBaseElement {
|
|
|
54
54
|
yExtentComponentsChangedSubject: Subject<void>;
|
|
55
55
|
get scale(): ScaleModel;
|
|
56
56
|
get yAxis(): YAxisComponent;
|
|
57
|
-
get dataSeries(): DataSeriesModel<import("../../model/data-series.model").DataSeriesPoint, import("../../model/data-series.model").VisualSeriesPoint>[];
|
|
57
|
+
get dataSeries(): DataSeriesModel<import("../../model/data-series.model").DataSeriesPoint, import("../../model/data-series.model").VisualSeriesPoint, import("../../model/data-series.config").DataSeriesConfig>[];
|
|
58
58
|
get visible(): boolean;
|
|
59
59
|
mainExtent: YExtentComponent;
|
|
60
60
|
constructor(chartBaseModel: ChartBaseModel<'candle'>, mainCanvasModel: CanvasModel, yAxisLabelsCanvasModel: CanvasModel, dynamicObjectsCanvasModel: CanvasModel, hitTestController: PaneHitTestController, config: FullChartConfig, mainScale: ScaleModel, drawingManager: DrawingManager, chartPanComponent: ChartPanComponent, canvasInputListener: CanvasInputListenerComponent, canvasAnimation: CanvasAnimation, cursorHandler: CursorHandler, eventBus: EventBus, canvasBoundsContainer: CanvasBoundsContainer, uuid: string, seriesAddedSubject: Subject<DataSeriesModel>, seriesRemovedSubject: Subject<DataSeriesModel>, hitTestCanvasModel: HitTestCanvasModel, chartResizeHandler: ChartResizeHandler, options?: AtLeastOne<YExtentCreationOptions>);
|
|
@@ -1,8 +1,3 @@
|
|
|
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
|
-
*/
|
|
6
1
|
/*
|
|
7
2
|
* Copyright (C) 2019 - 2025 Devexperts Solutions IE Limited
|
|
8
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
@@ -66,7 +61,7 @@ export class PaneComponent extends ChartBaseElement {
|
|
|
66
61
|
this.mainExtent = yExtentComponent;
|
|
67
62
|
this.ht = this.canvasBoundsContainer.getBoundsHitTest(CanvasElement.PANE_UUID(uuid), {
|
|
68
63
|
// this is needed to reduce cross event fire zone, so cross event won't be fired when hover resizer
|
|
69
|
-
// maybe we need to rework it, this isn't perfect
|
|
64
|
+
// maybe we need to rework it, this isn't perfect: top and bottom panes will have small no-hover area
|
|
70
65
|
extensionY: -this.config.components.paneResizer.dragZone,
|
|
71
66
|
});
|
|
72
67
|
}
|
|
@@ -138,7 +133,7 @@ export class PaneComponent extends ChartBaseElement {
|
|
|
138
133
|
// creating partially resolved constructor except formatter & dataSeriesProvider - bcs it's not possible to provide formatter
|
|
139
134
|
// before y-extent is created
|
|
140
135
|
const createYAxisComponent = (formatter, dataSeriesProvider) => new YAxisComponent(this.eventBus, this.config, this.yAxisLabelsCanvasModel, scaleModel, this.canvasInputListener, this.canvasBoundsContainer, this.chartPanComponent, this.cursorHandler, formatter, dataSeriesProvider, this.uuid, extentIdx, this.hitTestCanvasModel, this.chartResizeHandler, initialYAxisState);
|
|
141
|
-
const yExtentComponent = new YExtentComponent(this.uuid, extentIdx, this, this.chartBaseModel, this.canvasBoundsContainer, this.hitTestController, this.dynamicObjectsCanvasModel, scaleModel, createYAxisComponent, dragNDrop);
|
|
136
|
+
const yExtentComponent = new YExtentComponent(this.config.components.yAxis, this.uuid, extentIdx, this, this.chartBaseModel, this.canvasBoundsContainer, this.hitTestController, this.dynamicObjectsCanvasModel, scaleModel, createYAxisComponent, dragNDrop);
|
|
142
137
|
yExtentComponent.addSubscription(unsub);
|
|
143
138
|
yExtentComponent.addSubscription(this.addCursors(extentIdx, yExtentComponent.yAxis));
|
|
144
139
|
(options === null || options === void 0 ? void 0 : options.paneFormatters) && yExtentComponent.setValueFormatters(options.paneFormatters);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
|
|
4
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
5
|
*/
|
|
6
|
+
import { YAxisConfig, YAxisConfigTreasuryFormat } from '../../chart.config';
|
|
6
7
|
import { DataSeriesModel } from '../../model/data-series.model';
|
|
7
8
|
import { ViewportModel } from '../../model/scaling/viewport.model';
|
|
8
9
|
import { NumericAxisLabelsGenerator, PriceAxisType } from '../labels_generator/numeric-axis-labels.generator';
|
|
@@ -11,8 +12,9 @@ import { NumericAxisLabelsGenerator, PriceAxisType } from '../labels_generator/n
|
|
|
11
12
|
*/
|
|
12
13
|
export declare class NumericYAxisLabelsGenerator extends NumericAxisLabelsGenerator {
|
|
13
14
|
private dataSeriesProvider;
|
|
14
|
-
constructor(increment: number | null, dataSeriesProvider: () => DataSeriesModel | undefined, viewportModel: ViewportModel, valueFormatter: (value: number) => string, axisTypeProvider
|
|
15
|
+
constructor(increment: number | null, dataSeriesProvider: () => DataSeriesModel | undefined, viewportModel: ViewportModel, valueFormatter: (value: number) => string, axisTypeProvider: (() => PriceAxisType) | undefined, singleLabelHeightPixels: number | undefined, config: YAxisConfig);
|
|
15
16
|
getLargestLabel(): string;
|
|
17
|
+
updateTreasuryFormat(treasuryFormat: YAxisConfigTreasuryFormat): void;
|
|
16
18
|
/**
|
|
17
19
|
* Calculates the increment to be used on the chart axis based on the length of the value and the instrument's price increments.
|
|
18
20
|
* @param {number} valueLength - The length of the value.
|
|
@@ -5,32 +5,37 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { lastOf } from '../../utils/array.utils';
|
|
7
7
|
import { precisionsToIncrement } from '../../utils/price-increments.utils';
|
|
8
|
+
import { TREASURY_32ND } from '../chart/price-formatters/treasury-price.formatter';
|
|
8
9
|
import { NumericAxisLabelsGenerator } from '../labels_generator/numeric-axis-labels.generator';
|
|
9
10
|
/**
|
|
10
11
|
* Y axis labels generator for prices. Respects price increment from instrument.
|
|
11
12
|
*/
|
|
12
13
|
export class NumericYAxisLabelsGenerator extends NumericAxisLabelsGenerator {
|
|
13
|
-
constructor(increment, dataSeriesProvider, viewportModel, valueFormatter, axisTypeProvider = () => 'regular', singleLabelHeightPixels = 23) {
|
|
14
|
-
super(increment, () => [viewportModel.yStart, viewportModel.yEnd], () => viewportModel.getBounds().height, valueFormatter, false, axisTypeProvider, () => { var _a, _b; return (_b = (_a = dataSeriesProvider()) === null || _a === void 0 ? void 0 : _a.getBaseline()) !== null && _b !== void 0 ? _b : 1; }, undefined, singleLabelHeightPixels);
|
|
14
|
+
constructor(increment, dataSeriesProvider, viewportModel, valueFormatter, axisTypeProvider = () => 'regular', singleLabelHeightPixels = 23, config) {
|
|
15
|
+
super(increment, () => [viewportModel.yStart, viewportModel.yEnd], () => viewportModel.getBounds().height, valueFormatter, false, axisTypeProvider, () => { var _a, _b; return (_b = (_a = dataSeriesProvider()) === null || _a === void 0 ? void 0 : _a.getBaseline()) !== null && _b !== void 0 ? _b : 1; }, undefined, singleLabelHeightPixels, config);
|
|
15
16
|
this.dataSeriesProvider = dataSeriesProvider;
|
|
16
17
|
}
|
|
17
18
|
getLargestLabel() {
|
|
18
19
|
var _a;
|
|
19
20
|
return ((_a = this.labelsCache.getLastCachedValue()) !== null && _a !== void 0 ? _a : []).reduce((maxLengthText, label) => (label.text.length > maxLengthText.length ? label.text : maxLengthText), '');
|
|
20
21
|
}
|
|
22
|
+
updateTreasuryFormat(treasuryFormat) {
|
|
23
|
+
this.treasuryFormat = treasuryFormat;
|
|
24
|
+
}
|
|
21
25
|
/**
|
|
22
26
|
* Calculates the increment to be used on the chart axis based on the length of the value and the instrument's price increments.
|
|
23
27
|
* @param {number} valueLength - The length of the value.
|
|
24
28
|
* @returns {number} - The calculated increment.
|
|
25
29
|
*/
|
|
26
30
|
calculateIncrement(valueLength) {
|
|
27
|
-
var _a;
|
|
31
|
+
var _a, _b;
|
|
28
32
|
const dataSeries = this.dataSeriesProvider();
|
|
29
33
|
if (dataSeries) {
|
|
30
34
|
const lastCandle = lastOf(dataSeries.dataPoints);
|
|
31
35
|
const priceIncrementBasis = (_a = lastCandle === null || lastCandle === void 0 ? void 0 : lastCandle.close) !== null && _a !== void 0 ? _a : 0;
|
|
32
36
|
const increment = precisionsToIncrement(priceIncrementBasis, dataSeries.pricePrecisions);
|
|
33
|
-
|
|
37
|
+
const calculatedIncrement = ((_b = this.treasuryFormat) === null || _b === void 0 ? void 0 : _b.enabled) ? TREASURY_32ND : increment;
|
|
38
|
+
return this.adjustIncrementOnAxisType(calculatedIncrement);
|
|
34
39
|
}
|
|
35
40
|
// auto-generated increment
|
|
36
41
|
return super.calculateIncrement(valueLength);
|
|
@@ -14,7 +14,7 @@ export class YAxisModel extends ChartBaseElement {
|
|
|
14
14
|
this.state = state;
|
|
15
15
|
this.canvasBoundsContainer = canvasBoundsContainer;
|
|
16
16
|
this.extentIdx = extentIdx;
|
|
17
|
-
this.labelsGenerator = new NumericYAxisLabelsGenerator(null, dataSeriesProvider, scale, valueFormatter, () => this.state.type, state.labelHeight);
|
|
17
|
+
this.labelsGenerator = new NumericYAxisLabelsGenerator(null, dataSeriesProvider, scale, valueFormatter, () => this.state.type, state.labelHeight, state);
|
|
18
18
|
this.baseLabelsModel = new YAxisBaseLabelsModel(scale, this.labelsGenerator, this.canvasBoundsContainer, paneUUID, extentIdx);
|
|
19
19
|
this.addChildEntity(this.baseLabelsModel);
|
|
20
20
|
this.fancyLabelsModel = new FancyYAxisLabelsModel(eventBus, scale, canvasBoundsContainer, state, canvasModel, paneUUID, () => this.canvasBoundsContainer.updateYAxisWidths(), chartResizeHandler);
|
|
@@ -43,7 +43,7 @@ export interface DataSeriesViewportIndexes {
|
|
|
43
43
|
* If the data is presented as two-dim array when every data array will be drawn as a separate time-series
|
|
44
44
|
* For example, linear chart type will be drawn with gaps on the chart
|
|
45
45
|
*/
|
|
46
|
-
export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint, V extends VisualSeriesPoint = VisualSeriesPoint> extends ChartBaseElement {
|
|
46
|
+
export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint, V extends VisualSeriesPoint = VisualSeriesPoint, C extends DataSeriesConfig = DataSeriesConfig> extends ChartBaseElement {
|
|
47
47
|
extentComponent: YExtentComponent;
|
|
48
48
|
id: string;
|
|
49
49
|
htId: number;
|
|
@@ -51,7 +51,7 @@ export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint
|
|
|
51
51
|
name: string;
|
|
52
52
|
highlighted: boolean;
|
|
53
53
|
yAxisLabelProvider: DataSeriesYAxisLabelsProvider;
|
|
54
|
-
readonly config:
|
|
54
|
+
readonly config: C;
|
|
55
55
|
scale: ScaleModel;
|
|
56
56
|
view: DataSeriesView;
|
|
57
57
|
protected _dataPoints: D[][];
|
|
@@ -59,7 +59,7 @@ export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint
|
|
|
59
59
|
/**
|
|
60
60
|
* Should be used for paint tools like rectangular drawing or diff cloud
|
|
61
61
|
*/
|
|
62
|
-
linkedDataSeriesModels: DataSeriesModel<D, V>[];
|
|
62
|
+
linkedDataSeriesModels: DataSeriesModel<D, V, C>[];
|
|
63
63
|
highLowProvider: HighLowProvider;
|
|
64
64
|
get dataPoints2D(): D[][];
|
|
65
65
|
get dataPoints(): D[];
|
|
@@ -72,7 +72,7 @@ export declare class DataSeriesModel<D extends DataSeriesPoint = DataSeriesPoint
|
|
|
72
72
|
get visualPoints(): V[];
|
|
73
73
|
get visualPoints2D(): V[][];
|
|
74
74
|
set visualPoints(points: V[][] | V[]);
|
|
75
|
-
constructor(extentComponent: YExtentComponent, id: string, htId: number, parentId?: string | number | undefined, _config?: AtLeastOne<
|
|
75
|
+
constructor(extentComponent: YExtentComponent, id: string, htId: number, parentId?: string | number | undefined, _config?: AtLeastOne<C>);
|
|
76
76
|
protected doActivate(): void;
|
|
77
77
|
/**
|
|
78
78
|
* Sets the data points and recalculates internal state
|
|
@@ -66,7 +66,7 @@ export class DataSeriesModel extends ChartBaseElement {
|
|
|
66
66
|
this._visualPoints = create2DArray(points);
|
|
67
67
|
this._visualPointsFlat = this._visualPoints.flat();
|
|
68
68
|
}
|
|
69
|
-
constructor(extentComponent, id, htId, parentId, _config
|
|
69
|
+
constructor(extentComponent, id, htId, parentId, _config) {
|
|
70
70
|
var _a;
|
|
71
71
|
super();
|
|
72
72
|
this.extentComponent = extentComponent;
|
|
@@ -130,7 +130,8 @@ export class DataSeriesModel extends ChartBaseElement {
|
|
|
130
130
|
const points = this.visualPoints;
|
|
131
131
|
return lastOf(points);
|
|
132
132
|
};
|
|
133
|
-
|
|
133
|
+
const config = _config !== null && _config !== void 0 ? _config : cloneUnsafe(DEFAULT_DATA_SERIES_CONFIG);
|
|
134
|
+
this.config = merge(config, DEFAULT_DATA_SERIES_CONFIG);
|
|
134
135
|
this.scale = extentComponent.scale;
|
|
135
136
|
this.view = new DataSeriesView(this, this.scale, () => this.extentComponent.yAxis.getAxisType(), this.getBaseline);
|
|
136
137
|
this.yAxisLabelProvider = new DataSeriesYAxisLabelsProvider(this, this.config, extentComponent.getYAxisBounds, (_a = extentComponent.yAxis) === null || _a === void 0 ? void 0 : _a.state);
|