From b0d4f6bc4cc2642bb76d95ad84b0c8a1ecc50d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B0=D1=83=D1=84=20=D0=9B=D0=B0=D1=82=D1=8B=D0=BF?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Thu, 9 Jan 2025 16:40:49 +0300 Subject: [PATCH] SUPPORT-8717: + new label formatter for number to local string --- .../formatters/LabelNumberToLocalStringFormatter.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 frontend/src/ts/ervu_business_metrics/component/chart/plugin/formatters/LabelNumberToLocalStringFormatter.ts diff --git a/frontend/src/ts/ervu_business_metrics/component/chart/plugin/formatters/LabelNumberToLocalStringFormatter.ts b/frontend/src/ts/ervu_business_metrics/component/chart/plugin/formatters/LabelNumberToLocalStringFormatter.ts new file mode 100644 index 0000000..6c01c37 --- /dev/null +++ b/frontend/src/ts/ervu_business_metrics/component/chart/plugin/formatters/LabelNumberToLocalStringFormatter.ts @@ -0,0 +1,13 @@ +import { + ChartLabelModel +} from "../../../../../generated/ervu_business_metrics/model/chart/round/label/ChartLabelModel"; +import {NumberToLocalStringFormatter} from "../../../../formatter/NumberToLocalStringFormatter"; +import {ChartLabelFormatter} from "./ChartLabelFormatter"; + +export class LabelNumberToLocalStringFormatter implements ChartLabelFormatter { + private readonly textFormatter = new NumberToLocalStringFormatter(); + + format(label: ChartLabelModel, labels?: ChartLabelModel[], index?: number): void { + label.text = this.textFormatter.format(label.text); + } +}