Fix dashboard chart types so the production web build can pass.

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