Let ECharts infer dashboard tooltip types so vue-tsc accepts the build.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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: [
|
||||
|
||||
Reference in New Issue
Block a user