12 Dec 2022
	
		
		04:06 PM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 - last edited on 
    
	
		
		
		20 Apr 2023
	
		
		08:59 AM
	
	
	
	
	
	
	
	
	
	
	
	
	
	
 by 
				
		 educampver
		
			educampver
		
		
		
		
		
		
		
		
	
			
		
Hello team, I've been getting an error while trying to create the pie chart, I've even copied the code available in the documentation and I've been getting this error:
error: TS2322 Type '{ slices: { category: string; value: number; }[]; unit: string; }' is not assignable to type '{ category: string; value: number; }[]'.
Any ideas on why it might be doing this ?
Solved! Go to Solution.
12 Dec 2022 09:15 PM
Hey,
looks like you instead of passing the whole conversions object into the pie chart, you are only passing in the slices array. Can you share your code?
13 Dec 2022 08:46 AM
I've noticed that there has been a working solution proposed on our internal Slack, so I am cross-posting it here as a reference for others encountering the same problem.
{
  slices: {
    category: string;
    value: number; }[];
  unit: string;
}
{
  category: string;
  value: number
}[]
