Merge pull request #560 from RickCole21/master

chart clickAction ctx数据修复
This commit is contained in:
liaoxuezhi 2020-04-21 15:06:43 +08:00 committed by GitHub
commit 750bed1e68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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) {