Skip to content

Commit

Permalink
fix(data-vi): issue where data transformations do not work on tooltip…
Browse files Browse the repository at this point in the history
… in dual-axies charts (nocobase#5649)
  • Loading branch information
2013xile authored Nov 14, 2024
1 parent c607e88 commit b1fcfe0
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b1fcfe0

Please sign in to comment.