Fix dashboard chart types so the production web build can pass.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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: [
|
||||||
|
|||||||
Reference in New Issue
Block a user