Let ECharts infer dashboard tooltip types so vue-tsc accepts the build.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-10 02:42:55 +03:30
co-authored by Cursor
parent 601bc163b3
commit 55432ff979
2 changed files with 4 additions and 8 deletions
@@ -27,9 +27,9 @@ const option = computed<UiChartOption>(() => ({
tooltip: {
trigger: 'axis',
textStyle: { fontFamily: 'IRANSans, Tahoma, sans-serif' },
formatter: (params: { dataIndex?: number } | Array<{ dataIndex?: number }>) => {
formatter: (params) => {
const row = Array.isArray(params) ? params[0] : params;
const point = trend.value[row?.dataIndex ?? 0];
const point = trend.value[row.dataIndex ?? 0];
if (!point) return '';
return `${point.monthLabel}<br/>${props.formatAmount(point.amount)}`;
},
@@ -27,13 +27,9 @@ const option = computed<UiChartOption>(() => ({
tooltip: {
trigger: 'item',
textStyle: { fontFamily: 'IRANSans, Tahoma, sans-serif' },
formatter: (
p:
| { name?: string; value?: number; percent?: number }
| Array<{ name?: string; value?: number; percent?: number }>,
) => {
formatter: (p) => {
const item = Array.isArray(p) ? p[0] : p;
return `${item?.name ?? ''}<br/>${toFaDigits(Number(item?.value ?? 0))} — ${toFaDigits(item?.percent ?? 0)}٪`;
return `${item.name}<br/>${toFaDigits(Number(item.value ?? 0))} — ${toFaDigits(item.percent ?? 0)}٪`;
},
},
series: [