diff --git a/examples/components/EventAction/cmpt-event-action/ChartEvent.jsx b/examples/components/EventAction/cmpt-event-action/ChartEvent.jsx index 16a655bd8..eb782da0f 100644 --- a/examples/components/EventAction/cmpt-event-action/ChartEvent.jsx +++ b/examples/components/EventAction/cmpt-event-action/ChartEvent.jsx @@ -45,6 +45,16 @@ export default { } } ] + }, + legendselectchanged: { + actions: [ + { + actionType: 'toast', + args: { + msg: '${event.data|json}' + } + } + ] } }, config: { diff --git a/packages/amis/src/renderers/Chart.tsx b/packages/amis/src/renderers/Chart.tsx index 3157fe068..e770b9935 100644 --- a/packages/amis/src/renderers/Chart.tsx +++ b/packages/amis/src/renderers/Chart.tsx @@ -309,7 +309,7 @@ export class Chart extends React.Component { const {data, dispatchEvent} = this.props; dispatchEvent( - (ctx as any).event, + (ctx as any).event || ctx.type, createObject(data, { ...pick( ctx,