chart clickAction ctx数据修复

This commit is contained in:
rickcole 2020-04-21 15:03:11 +08:00
parent becdfb581d
commit e7fd953eff
1 changed files with 5 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import {resizeSensor} from '../utils/resize-sensor';
import {resolveVariableAndFilter, isPureVariable} from '../utils/tpl-builtin';
import {isApiOutdated, isEffectiveApi} from '../utils/api';
import {ScopedContext, IScopedContext} from '../Scoped';
import {createObject} from '../utils/helper';
export interface ChartProps extends RendererProps {
chartRef?: (echart: any) => void;
@ -89,9 +90,11 @@ export class Chart extends React.Component<ChartProps> {
}
handleClick(ctx: object) {
const {onAction, clickAction} = this.props;
const {onAction, clickAction, data} = this.props;
clickAction && onAction && onAction(null, clickAction, ctx);
clickAction &&
onAction &&
onAction(null, clickAction, createObject(data, ctx));
}
refFn(ref: any) {