Pie Charts - Graying out unselected slices

2 posts, 0 answers
  1. Kristopher
    Kristopher avatar
    1 posts
    Member since:
    Jan 2019

    Posted 11 Feb 2019 Link to this post

    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.

  2. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    1263 posts

    Posted 13 Feb 2019 Link to this post

    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.
Back to Top