@devexperts/dxcharts-lite 2.7.19 → 2.7.21

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.
@@ -512,6 +512,7 @@ export interface ChartConfigComponentsHighLow {
512
512
  high: string;
513
513
  low: string;
514
514
  };
515
+ lineDash: Array<number>;
515
516
  }
516
517
  export interface ChartConfigComponentsCrossTool {
517
518
  /**
@@ -763,6 +764,7 @@ export interface YAxisLabelColorConfig {
763
764
  boxColor: string;
764
765
  textColor?: string;
765
766
  descriptionText?: string;
767
+ descriptionTextColor?: string;
766
768
  }
767
769
  export interface YAxisLastPriceLabelColorConfig {
768
770
  boxSelected: string;
@@ -204,7 +204,7 @@ export const getDefaultConfig = () => ({
204
204
  logoWidth: 20,
205
205
  logoHeight: 20,
206
206
  },
207
- highLow: { visible: false, font: '12px sans-serif', prefix: { high: 'H: ', low: 'L: ' } },
207
+ highLow: { visible: false, font: '12px sans-serif', prefix: { high: 'H: ', low: 'L: ' }, lineDash: [2, 4] },
208
208
  highlights: {
209
209
  visible: false,
210
210
  fontFamily: 'Open Sans',
@@ -65,7 +65,8 @@ export function drawLabel(ctx, yAxisDescriptionsCtx, backgroundCtx, bounds, pane
65
65
  lineXEnd = chartBounds.x + chartBounds.width;
66
66
  }
67
67
  const lineY = (_e = visualLabel.lineY) !== null && _e !== void 0 ? _e : visualLabel.y;
68
- const _drawLine = () => showLine && avoidAntialiasing(ctx, () => drawLine(ctx, lineXStart, lineY, lineXEnd, lineY, 1));
68
+ const _drawLine = () => showLine &&
69
+ avoidAntialiasing(ctx, () => drawLine(ctx, lineXStart, lineY, lineXEnd, lineY, 1, visualLabel.lineDash));
69
70
  const _drawLabel = () => drawLabel(ctx, bounds, replaceMinusSign(text), centralY, visualLabel, config, colors.yAxis, false);
70
71
  const drawLineLabel = () => {
71
72
  _drawLine();
@@ -25,6 +25,7 @@ export interface YAxisLabelDrawConfig {
25
25
  paddingEnd?: number;
26
26
  paddingStart?: number;
27
27
  rounded?: boolean;
28
+ lineDash?: Array<number>;
28
29
  }
29
30
  export declare const DEFAULT_PRICE_LABEL_PADDING = 4;
30
31
  /**
@@ -4,11 +4,12 @@
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 { MouseButton, leftMouseButtonListener, subscribeListener } from '../utils/dom.utils';
7
- import { merge, Subject } from 'rxjs';
7
+ import { asyncScheduler, fromEvent, merge, Subject } from 'rxjs';
8
8
  import { ChartBaseElement } from '../model/chart-base-element';
9
- import { distinctUntilChanged, filter, map, tap } from 'rxjs/operators';
9
+ import { distinctUntilChanged, filter, map, tap, throttleTime } from 'rxjs/operators';
10
10
  import { EVENT_RESIZED } from '../events/events';
11
11
  import { deviceDetector } from '../utils/device/device-detector.utils';
12
+ import { ONE_FRAME_MS } from '../utils/numeric-constants.utils';
12
13
  /**
13
14
  * Gathers user input on canvas element:
14
15
  * Chart update order should be following:
@@ -373,6 +374,9 @@ export class CanvasInputListenerComponent extends ChartBaseElement {
373
374
  this.canvasBounds.width = bcr.width;
374
375
  this.canvasBounds.height = bcr.height;
375
376
  }));
377
+ this.addRxSubscription(fromEvent(document, 'scroll', { capture: true, passive: true })
378
+ .pipe(throttleTime(ONE_FRAME_MS, asyncScheduler, { trailing: true }))
379
+ .subscribe(() => this.invalidateRectCache()));
376
380
  const mouseLeaveListener = () => {
377
381
  this.mouseLeavesCanvasSubject.next(true);
378
382
  };
@@ -46,7 +46,7 @@ export declare function drawPriceLabel(ctx: CanvasRenderingContext2D, x0: number
46
46
  *
47
47
  * @returns {void}
48
48
  */
49
- export declare function drawLine(ctx: CanvasRenderingContext2D, x0: number, y0: number, x1: number, y1: number, thickness?: number): void;
49
+ export declare function drawLine(ctx: CanvasRenderingContext2D, x0: number, y0: number, x1: number, y1: number, thickness?: number, lineDash?: Array<number>): void;
50
50
  /**
51
51
  * Try to avoid anti-aliasing
52
52
  */
@@ -109,8 +109,9 @@ export function drawPriceLabel(ctx, x0, y0, x1, y1, x2, y2, _width, rounded, ali
109
109
  *
110
110
  * @returns {void}
111
111
  */
112
- export function drawLine(ctx, x0, y0, x1, y1, thickness = 1) {
112
+ export function drawLine(ctx, x0, y0, x1, y1, thickness = 1, lineDash = []) {
113
113
  ctx.save();
114
+ ctx.setLineDash(lineDash);
114
115
  ctx.lineWidth = thickness;
115
116
  ctx.beginPath();
116
117
  ctx.moveTo(x0, y0);