You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
publicchartClicked(event: {event?: ChartEvent;active?: object[]}): void{if(event.active&&event.active.length>0){constmyChartDataLabelIndex=event.active[0].index;// `Property 'index' does not exist on type 'object'.ts(2339)`console.log(myChartDataLabelIndex);}}
We would love to see this fixed, I looked around in the codebase and found no reason for active to be typed as the less restrictive object[]... Nor for the possibility of leaving those undefined either.
To be honest, even better would be a
type ChartMouseEvent = { event:ChartEvent, active: ActiveElement[] }
Reproduction of the problem
Suggested fix:
libs/ng2-charts/src/lib/base-chart.directive.ts
The text was updated successfully, but these errors were encountered: