From 778d57753d987ce1dceae36768770e0104b937c2 Mon Sep 17 00:00:00 2001 From: Anton Vorobev Date: Wed, 4 Sep 2024 10:01:07 +0000 Subject: [PATCH] Pull request #5278: Feature/DXCF-5602 improve watermark behaviour for library Merge in DXCHARTS/dxchart5 from feature/DXCF-5602-improve-watermark-behaviour-for-library to master * commit '88ea0c3a22328a274bef532241ec2ef7b12dccaa': [DXCF-5602] Improve watermark behaviour for Library // pr fix [DXCF-5602] Improve watermark behaviour for Library // pr fix [DXCF-5602] Improve watermark behaviour for Library [DXCF-5602] Improve watermark behaviour for Library // init [DXCF-5602] Improve watermark behaviour for Library // revert [DXCF-5602] Improve watermark behaviour for Library // init GitOrigin-RevId: edcd885f8594946ff73619dfc50ed83a670fd530 --- src/chart/chart.config.ts | 2 +- .../watermark/water-mark.component.ts | 21 +++++-------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/chart/chart.config.ts b/src/chart/chart.config.ts index 261cbe4f..c95f4174 100644 --- a/src/chart/chart.config.ts +++ b/src/chart/chart.config.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited + * Copyright (C) 2019 - 2024 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/. */ diff --git a/src/chart/components/watermark/water-mark.component.ts b/src/chart/components/watermark/water-mark.component.ts index a1d4cae4..1156f560 100644 --- a/src/chart/components/watermark/water-mark.component.ts +++ b/src/chart/components/watermark/water-mark.component.ts @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019 - 2023 Devexperts Solutions IE Limited + * Copyright (C) 2019 - 2024 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/. */ @@ -15,16 +15,6 @@ import { ChartModel } from '../chart/chart.model'; import { PaneManager } from '../pane/pane-manager.component'; import { WaterMarkDrawer } from './water-mark.drawer'; -export interface WaterMarkConfig { - isVisible?: boolean; - fontFamily?: string; - firstRowFontSize?: number; - firstRowBottomPadding?: number; - secondRowFontSize?: number; - secondRowBottomPadding?: number; - thirdRowFontSize?: number; -} - export interface WaterMarkData { firstRow?: string; secondRow?: string; @@ -103,23 +93,22 @@ export class WaterMarkComponent extends ChartBaseElement { /** * Sets the watermark configuration for the chart. - * @param {WaterMarkConfig} watermarkConfig - The configuration object for the watermark. + * @param {ChartConfigComponentsWaterMark} watermarkConfig - The configuration object for the watermark. * @returns {void} */ - public setWaterMarkConfig(watermarkConfig: WaterMarkConfig): void { + public setWaterMarkConfig(watermarkConfig: ChartConfigComponentsWaterMark): void { if (!watermarkConfig || !this.config.components) { return; } if (!this.config.components.waterMark) { this.config.components.waterMark = JSON.parse(JSON.stringify(watermarkConfig)); } else { - const newWatermark: WaterMarkConfig = {}; + const newWatermark: Partial = {}; merge(newWatermark, watermarkConfig); merge(newWatermark, this.config.components.waterMark); // eslint-disable-next-line no-restricted-syntax - this.config.components.waterMark = newWatermark as ChartConfigComponentsWaterMark & - Required; + this.config.components.waterMark = newWatermark as ChartConfigComponentsWaterMark; } this.canvasModel.fireDraw(); }