How to show percentage in dashboard designer in column chart

by ramanin » Wed Mar 09, 2016 4:27 am

Dear All,

Greetings, I'm using Dashboard designer, I Would like to show the percentage in the management dashboard. For example, the value of completed is 50 out of 100. so the result should say 50/100*100 = 50% in my graphical view in the each column bar. Please let me know if anything needs and thanks in advance. It will be helpful if you tell in detailed step.

Best Regards
Ram
ramanin
 
Posts: 3
Joined: Wed Mar 09, 2016 4:10 am

by Rostislav » Wed Mar 09, 2016 10:45 am

Hello,

Place the following code into the template section of the tooltip or label section (whichever you use to display the value) in Dashboard->Style:

Code: Select all
#= kendo.format("{0:p2}", value / 100) #

Where value is the name of the field where the value is contained and 100 can either stay 100, or be replaced with the name of the field where the total is contained (depends on what you want to do).
User avatar
Rostislav
 
Posts: 61
Joined: Fri Oct 09, 2015 10:51 am

by ramanin » Thu Mar 10, 2016 10:29 am

Hi,

Thanks for your reply.. I tried to use the same code to get the percentage of field.. but unfortunately I'm getting the error message.

I have used to replace the "value" in the code as "ID" like below:

#= kendo.format("{0:p2}", ID / 100) #

but am getting error as "Undefined ID".

I have tried to modify in some other formats as well, but it didn't help me out. can you please let me know what exactly should I use to get percentage.. Thanks in advance.

Best Regards
Ram
ramanin
 
Posts: 3
Joined: Wed Mar 09, 2016 4:10 am

by Rostislav » Thu Mar 10, 2016 11:26 am

Sorry, I'm actually wrong! Please use the following template:

Code: Select all
#= kendo.format("{0:p2}", dataItem.ID / 100) #


Note that ID must be available as a field selection in Dashboard -> Chart for this to work.
User avatar
Rostislav
 
Posts: 61
Joined: Fri Oct 09, 2015 10:51 am

by ramanin » Fri Mar 11, 2016 4:30 am

Hi,

It is exactly works fine.. But one thing is that, the value which is mentioned here as 100 should get dynamically updated, It means the count of item. so that the exact percentage matches the scenario

#= kendo.format("{0:p2}", dataItem.ID / 100) #

Please let me know any other alternatives which i can use it.

And also where can i study the coding standard for this plumsail chart, any documentation plz it will be helpful for us.

Best Regards
Ram
ramanin
 
Posts: 3
Joined: Wed Mar 09, 2016 4:10 am

by Rostislav » Fri Mar 11, 2016 12:47 pm

Documentation you can find here: http://www.spchart.com/demo. You can read Documentation or check out various demo charts together with their configurations.

This will work if you're using the "aggregate over category" option. If that's not what you want, please describe your use case in more detail.

1. In Dashboard->Advanced add the following piece of code to the preRender function:
Code: Select all
  $.each(config.series, function(){
    var series = this;
    $.each(series.data, function(){
      this.count = series.data.length;
    });
  });


Then your template will look like this:

Code: Select all
#= kendo.format("{0:p2}", dataItem.ID / dataItem.count) #


Although, to be fair, I don't quite understand why you want to divide the ID by the total count of items.
User avatar
Rostislav
 
Posts: 61
Joined: Fri Oct 09, 2015 10:51 am


Return to Dashboard Designer for SharePoint 2013

cron