diff --git a/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/dualAxes.ts b/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/dualAxes.ts index a538440bfcde7..de580001fe0bd 100644 --- a/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/dualAxes.ts +++ b/packages/plugins/@nocobase/plugin-data-visualization/src/client/chart/g2plot/dualAxes.ts @@ -84,6 +84,20 @@ export class DualAxes extends G2PlotChart { return { type: 'line', yField, + tooltip: { + items: [ + (data: any) => { + const { [yField]: y } = data; + const yFieldProps = fieldProps[yField]; + const name = yFieldProps?.label || yField; + const value = yFieldProps?.transformer ? yFieldProps.transformer(y) : y; + return { + name, + value, + }; + }, + ], + }, colorField: () => { const props = fieldProps[yField]; return props?.label || yField;