Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Normalizing size of multiple pie charts
rbguy
Hello,
I have a report that shows a series of 5 pie charts all next to each other. The problem is, when I preview or deploy the report, all the pie charts display as different sizes. Is there a quick way to force these pie charts to be all the same size?
Thanks!
Find more posts tagged with
Comments
kclark
You can set the size of the pie charts in the beforeGeneration() of the chart using something like this<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>chart.getBlock().getBounds().setWidth(x);
chart.getBlock().getBounds().setHeight(y);</pre>
rbguy
kclark, Thank you so much for the quick reply. Unfortunately, that appeared only to set the height and width of the area surrounding the pie chart. The pie charts stayed the same sizes. So I started looking around and I found this which seemed to work a little better:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>chart.getPlot().setWidthHint(124);
chart.getPlot().setHeightHint(124);</pre>
<br />
The problem with this however, the sizing values are not consistent for each pie chart. For example, one chart I set like the above code to 124,124, however, to get another chart to look the same size I had to use the values 155,155. It takes several iterations going back and forth to get them to be the same. I'm not sure if that is a bug, or there are other things in play that are affecting the size. It's a bit time consuming to do these iterations for each pie chart, but if that is my only option, I am okay with it.<br />
<br />
The other thing that I notice is that the distance between the title and the top of the pie chart are different heights. If there are any ideas on how to get this consistent as well, I would be grateful.<br />
Thanks!