This is a migrated thread and some comments may be shown as answers.

Pie Charts - Graying out unselected slices

1 Answer 94 Views
Charts
This is a migrated thread and some comments may be shown as answers.
Kristopher
Top achievements
Rank 1
Kristopher asked on 11 Feb 2019, 10:31 PM

I am using kendo pie charts to display a breakdown of data shown in a grid. When a user clicks a pie slice, it applies a filter to the grid. I would also like all the other pie slices to become grayed out while this filter is active.

 

I have tried to programatically change the color of the slices by updating the color in the data object the chart is bound to, but the changes do not show in the UI. I've got a feeling I'm missing something simple, but I can't figure it out. Is anyone able to offer advice on this? Thanks.

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 13 Feb 2019, 02:05 PM
Hi Kristopher,

A relatively straight-forward approach that comes to mind is to introduce an additional property to hold the original series item color, and then in the seriesClick handler to replace the data with one that is mapped so that all items, but the clicked one are gray, and the clicked one has its original color, e.g.:

https://stackblitz.com/edit/angular-4tihjp?file=app/app.component.ts

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Charts
Asked by
Kristopher
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or