@devexperts/dxcharts-lite 2.7.24 → 2.7.26
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/components/pane/extent/y-extent-component.js +12 -3
- package/dist/chart/drawers/data-series-drawers/difference-cloud.drawer.js +1 -1
- package/dist/chart/model/canvas.model.d.ts +1 -0
- package/dist/chart/model/canvas.model.js +5 -0
- package/dist/chart/model/data-series.model.js +1 -1
- package/dist/dxchart.min.js +4 -4
- package/package.json +16 -22
|
@@ -140,9 +140,18 @@ export class YExtentComponent extends ChartBaseElement {
|
|
|
140
140
|
export const createDefaultYExtentHighLowProvider = (extent) => ({
|
|
141
141
|
isHighLowActive: () => true,
|
|
142
142
|
calculateHighLow: state => {
|
|
143
|
-
const
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
const allDataSeries = Array.from(extent.dataSeries);
|
|
144
|
+
const activeDataSeries = allDataSeries.filter(ds => ds.highLowProvider.isHighLowActive());
|
|
145
|
+
const seriesToUse = activeDataSeries.length > 0 ? activeDataSeries : allDataSeries;
|
|
146
|
+
if (seriesToUse.length === 0) {
|
|
147
|
+
return { low: 0, high: 100 };
|
|
148
|
+
}
|
|
149
|
+
const highLows = seriesToUse
|
|
150
|
+
.map(ds => ds.highLowProvider.calculateHighLow(state))
|
|
151
|
+
.filter(hl => hl.high >= hl.low);
|
|
152
|
+
if (highLows.length === 0) {
|
|
153
|
+
return { low: 0, high: 100 };
|
|
154
|
+
}
|
|
146
155
|
return mergeHighLow(highLows);
|
|
147
156
|
},
|
|
148
157
|
});
|
|
@@ -35,12 +35,12 @@ export class DifferenceCloudDrawer {
|
|
|
35
35
|
if (isDifferenceTool(linkedSeries.config.type) &&
|
|
36
36
|
isDifferenceTool(model.config.type) &&
|
|
37
37
|
linkedShouldDrawCloud) {
|
|
38
|
-
const differencePoints = [];
|
|
39
38
|
const mainSeries = model;
|
|
40
39
|
const allPointsMain = mainSeries.getSeriesInViewport(mainSeries.scale.xStart - 1, mainSeries.scale.xEnd + 1);
|
|
41
40
|
const allPointsLinked = linkedSeries.getSeriesInViewport(linkedSeries.scale.xStart - 1, linkedSeries.scale.xEnd + 1);
|
|
42
41
|
allPointsMain.forEach((points, idx) => {
|
|
43
42
|
var _a, _b;
|
|
43
|
+
const differencePoints = [];
|
|
44
44
|
const to = Math.min(points.length, (_b = (_a = allPointsLinked[idx]) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0);
|
|
45
45
|
for (let k = 0; k < to; k++) {
|
|
46
46
|
const diffPoints = [
|
|
@@ -27,6 +27,7 @@ export declare class CanvasModel {
|
|
|
27
27
|
height: number;
|
|
28
28
|
prevHeight: number;
|
|
29
29
|
prevWidth: number;
|
|
30
|
+
private lastDPR;
|
|
30
31
|
private readonly _canvasId;
|
|
31
32
|
type: CanvasBarType;
|
|
32
33
|
constructor(eventBus: EventBus, canvas: HTMLCanvasElement, drawingManager: DrawingManager, canvasModels: CanvasModel[], resizer?: HTMLElement | undefined, options?: CanvasRenderingContext2DSettings);
|
|
@@ -23,6 +23,7 @@ export class CanvasModel {
|
|
|
23
23
|
this.height = 0;
|
|
24
24
|
this.prevHeight = 0;
|
|
25
25
|
this.prevWidth = 0;
|
|
26
|
+
this.lastDPR = 0;
|
|
26
27
|
this.type = CANDLE_TYPE;
|
|
27
28
|
canvasModels.push(this);
|
|
28
29
|
this.parent = findHeightParent(canvas);
|
|
@@ -42,6 +43,10 @@ export class CanvasModel {
|
|
|
42
43
|
updateDPR(bcr) {
|
|
43
44
|
const { width, height } = bcr;
|
|
44
45
|
const dpi = window.devicePixelRatio;
|
|
46
|
+
if (width === this.width && height === this.height && dpi === this.lastDPR) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.lastDPR = dpi;
|
|
45
50
|
this.canvas.style.height = height + 'px';
|
|
46
51
|
this.canvas.style.width = width + 'px';
|
|
47
52
|
this.canvas.width = width * dpi;
|
|
@@ -303,7 +303,7 @@ export const calculateDataSeriesHighLow = (visualCandles) => {
|
|
|
303
303
|
return result;
|
|
304
304
|
};
|
|
305
305
|
const createDataSeriesModelHighLowProvider = (dataSeries) => ({
|
|
306
|
-
isHighLowActive: () => dataSeries.config.highLowActive,
|
|
306
|
+
isHighLowActive: () => dataSeries.config.highLowActive && dataSeries.config.visible,
|
|
307
307
|
calculateHighLow: state => {
|
|
308
308
|
const highLow = calculateDataSeriesHighLow(dataSeries.getSeriesInViewport(state === null || state === void 0 ? void 0 : state.xStart, state === null || state === void 0 ? void 0 : state.xEnd).flat());
|
|
309
309
|
return Object.assign(Object.assign({}, highLow), { high: dataSeries.view.toAxisUnits(highLow.high), low: dataSeries.view.toAxisUnits(highLow.low) });
|