Forum Discussion

Risa_Brown's avatar
Risa_Brown
Data Storage
09-06-2022

Formatting Percentages in Pie Charts

Hello. 

How do you format the number of decimal points in a pie chart (widget) on my Periscope Dashboard? Within my chart, the chart displays percentages down to the thousandth place; which overwhelms my Evaluator. Any advice would be appreciated. 

2 Replies

Replies have been turned off for this discussion
  • Hi Risa_Brown ,

    Please use this script

    widget.on("ready", function (se, args){
    
    $('.pie-percent-label').each(function(i, obj){var Valuetext=$(this).text();
    
    
    var matches = Valuetext.match(/(\d+)/); if (matches) {
    
    
    
    var newValue=parseFloat(Valuetext)
    var value=newValue.toFixed(0);
    
    $(this).text(value+'%');
    }
    })
    });
    • denizakb's avatar
      denizakb
      Data Storage

      Where should we add this I'm wondering? Thank you!