fix(analytics): ObjectSaleChart tooltip показывает полный ₽/м², не /1000 (#1238)
Some checks are pending
Deploy / changes (push) Waiting to run
Deploy / build-backend (push) Blocked by required conditions
Deploy / build-worker (push) Blocked by required conditions
Deploy / build-frontend (push) Blocked by required conditions
Deploy / deploy (push) Blocked by required conditions
Some checks are pending
Deploy / changes (push) Waiting to run
Deploy / build-backend (push) Blocked by required conditions
Deploy / build-worker (push) Blocked by required conditions
Deploy / build-frontend (push) Blocked by required conditions
Deploy / deploy (push) Blocked by required conditions
Серия price делила data на 1000 без valueFormatter в tooltip → ось говорила
'тыс ₽/м²' но точки рисовались как 'обычные числа', tooltip показывал
'146' вместо '146 250 ₽/м²' (×1000 underreporting). Patch: убрал /1000
делитель, ось 'тыс ₽/м²' → '₽/м²', добавлен tooltip valueFormatter
'146 250 ₽/м²' через toLocaleString('ru'). 82/82 frontend тестов зелёные.
Closes #1238
This commit is contained in:
parent
ac446236e7
commit
67d24e9bf7
1 changed files with 6 additions and 2 deletions
|
|
@ -56,10 +56,14 @@ export function ObjectSaleChart({ objId }: { objId: number | string }) {
|
|||
yAxisIndex: 1,
|
||||
smooth: true,
|
||||
symbol: "circle",
|
||||
data: d.price.map((v) => (v ? Math.round(v / 1000) : null)),
|
||||
data: d.price.map((v) => (v ? Math.round(v) : null)),
|
||||
lineStyle: { color: type === "apartments" ? "#0a7a3a" : "#c2410c" },
|
||||
itemStyle: { color: type === "apartments" ? "#0a7a3a" : "#c2410c" },
|
||||
connectNulls: true,
|
||||
tooltip: {
|
||||
valueFormatter: (v: number | null) =>
|
||||
v == null ? "—" : `${v.toLocaleString("ru")} ₽/м²`,
|
||||
},
|
||||
},
|
||||
]);
|
||||
return {
|
||||
|
|
@ -69,7 +73,7 @@ export function ObjectSaleChart({ objId }: { objId: number | string }) {
|
|||
xAxis: { type: "category", data: months },
|
||||
yAxis: [
|
||||
{ type: "value", name: "шт", position: "left" },
|
||||
{ type: "value", name: "тыс ₽/м²", position: "right" },
|
||||
{ type: "value", name: "₽/м²", position: "right" },
|
||||
],
|
||||
series,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue