How do I show a count in a Pie chart in a similar way to the Bar chart labelsAbove property?


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Deepak on 26th July 2013
Hi,

I show total count in each slice of pie chart permanently as we are showing in bar chart using label above property. How to show that?


Regards,
Deepak
Posted by RGraph support on 26th July 2013
Hi there,

Can't quite tell what it is that you're asking - but by the sounds of it you may want these properties:

chart.labels.ingraph
chart.labels.ingraph.specific




Richard
Posted by Deepak on 26th July 2013
Hi,

It is working fine but it is showing 0 also.I want to show only if count is greater than 0 for that slice.




Regards,
Deepak
Posted by RGraph support on 26th July 2013
Hi there,

Simply loop through the values then and set any 0 values to an empty string.


Richard
Posted by Enter your name... on 26th July 2013
   Hi,

   I am doing that following way but not working can you explain how to apply for loop for that.

                     pie.Set('chart.labels.ingraph', true );
       for (var i=0; i<data.length; ++i) {
       if(pie.Get('chart.labels.ingraph')[i]>0)
      {
       pie.Get('labels.ingraph')[i] = pie.Get('chart.labels.ingraph')[i];
                       }
                   }


   Regards,
   Deepak
Posted by RGraph support on 26th July 2013
Hi there,

Try something like this:

www.rgraph.net/fiddle/view/a-pie-chart-with-ingraph-labels




Richard
Posted by Enter your name... on 26th July 2013
Hi,

Thanks for support...


Regards,
Deepak
Posted by SUNIL KUMAR YADAV on 19th April 2016
Hi,

I just want to set the background color of chart.labels.above in rGraph. But it's not working. Could any one can help?


And other is, I want to place chart.labels.ingraph at specific coordinate. Please help.

Thanks in advance!!!
Posted by Richard on 19th April 2016
Hi there,

There's no option for it - so you'll need to use the drawing API text object like this sample does:

www.rgraph.net/fiddle/view.html/bar-chart-with-no-grid


And for the second question if you use the drawing API text object again you can place text at any coordinates you'd like.




Richard

Add a reply




« Back to message list