Pie with Percentage example not working

Hi, I am trying to use your example of Pie with Percentage but getting an error  Property 'text' does not exist on type 'IAccTooltipRenderEventArgs'. 

Here is my code, which was basically a copy of yours;

public tooltipRenderPercent(args: IAccTooltipRenderEventArgs): void {
        let value = args.point.y / args.series.sumOfPoints * 100;
        args.text = args.point.x + ' : ' + Math.round(value) + '' + '%';
    };

Can you help me with getting this to work? I tried changing 'text' to 'content' but this didn't work either.

3 Replies 1 reply marked as answer

SM Srihari Muthukaruppan Syncfusion Team February 18, 2021 07:43 AM UTC

Hi Glen, 
 
We have analyzed your query. From that, we suggest you to get values from object using string literals to overcome the reported scenario. We have also prepared a sample for your reference. Please find the sample and code snippet below. 
 
 
Code Snippet: 
// add your additional code here 
 
public tooltipRenderPercent(args: IAccTooltipRenderEventArgs): void { 
          let value = (args.point.y / args.series.sumOfPoints) * 100; 
          args["text"] = args.point.x + " : " + Math.round(value) + "" + "%"; 
} 
// add your additional code here 
 
 
Let us know if you have any concerns. 
 
Regards, 
Srihari M 


Marked as answer

GA Glen Alexander February 19, 2021 03:43 AM UTC

Hi, thanks that worked. You might want to update your example here https://ej2.syncfusion.com/angular/documentation/chart/how-to/percentage-tool-tip/

Thanks again for a quick reply.


SM Srihari Muthukaruppan Syncfusion Team February 19, 2021 02:58 PM UTC

Hi Glen, 
 
Most welcome. 
 
We have also logged a documentation task on this internally. Kindly get in touch with us, if you requires further assistance. We are always happy in assisting you.   
   
Thanks,   
Srihari M 


Loader.
Up arrow icon