Modifying the ‘Others’ Slice in the Pie Chart



  • Avatar
    Jessica Orlando

    This is great, but is there a way to manually choose which values get grouped into 'Others' instead of the dynamic percentage?

    I have a client with a list of 6 values they want to see and everything else is grouped into Others. One of the values they want to see is Executive w/ only 0.43%, but they do not want to see Company or Accountant  so a percentage threshold will not work.

    Comment actions Permalink
  • Avatar
    Elliott Herz (Edited )

    Hey Jessica,

    There are a few solutions that could work in this case. The easiest would be to create a new field in the backend that is either the name of one of the 6 required values, or will default to Others if not one of the 6. Then you can group off of that new field, and everything that is Others will get grouped there.


    Another option would be to add a widget script that goes through the series and starts regrouping the categories that are in other. First would be to leverage the plugin to make the minimum slice % 0. Then another widget script which would be something like this:

    var displayCategories = ["Andrew Green", "Ben Franklin", "Rahul Patel"];

    widget.on('processresult', (el, args) => {
    var newSeries = Object.assign({}, args.result.series[0]); = [];
    var series = Object.assign({}, args.result.series[0]);
    var otherCategory = Object.assign({},[0]);
    otherCategory.queryResultIndex =;
    otherCategory.sliced = false;
    otherCategory.x =; = 'Others';
    otherCategory.y = 0; //Temporarily store 0 as the value
    otherCategory.selectionData = {};
    otherCategory.color = 'black';
    otherCategory.content = [];
    otherCategory.drilldown = 'Others';

    var dataPoints = 0;, index) => {
    if(displayCategories.indexOf( === -1) {
    otherCategory.y += item.y;
    otherCategory.selectionData[dataPoints] =;
    dataPoints += 1;
    } else {;
    args.result.series[0] = newSeries;

    This is definitely a work in progress, but illustrates the idea that you can group things in any way you want.


    Hope this gives you a good framework for solving this usecase.


    Best, Elliott

    Comment actions Permalink
  • Avatar
    Jessica Orlando

    Thanks Elliot. I ended up making a case statement field in the ElastiCube that groups the remaining fields under 'Other'.

    Comment actions Permalink

Please sign in to leave a comment.