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)
Adjust chart size based on number of categories and number of groups
roadblock2
I have a bar chart that has several bars, each of which displays several groups by color. I am comfortable adjusting the size of the chart based on the number of bars, but cannot figure out how to get the number of groups.
I use the beforeGeneration event handler to get the runTimeSeries of the yAxis and then set the height on the chart.
Does anyone know how to get the number of groups, or the number of legend entries?
Thanks,
Craig
Find more posts tagged with
Comments
mwilliams
Hi Craig,
So, this is when y-series grouping is set?
roadblock2
<blockquote class='ipsBlockquote' data-author="'mwilliams'" data-cid="70852" data-time="1291133284" data-date="30 November 2010 - 09:08 AM"><p>
Hi Craig,<br />
<br />
So, this is when y-series grouping is set?<br /></p></blockquote>
<br />
Thanks for the reply.<br />
<br />
Yes, the y-grouping is set
roadblock2
I found out a few things, but still have not solved my problem.<br />
<br />
I tried working in the beforeRendering event. This allowed me to adjust the bounds of the chart, but not the size of the chart itself using <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>gcs.getChartModel().getBlock.getBounds().setHeight(1000)</pre>
<br />
But the plot still remains the same size (the drawing of the chart that is)<br />
<br />
I know I am able to to change the size in the beforeGeneration event, but it appears that the legend is not filled yet. I tried to get the number of legend entries by<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>chart.getSeriesForLegend().length</pre>
<br />
It appears though, that the legend series has length 0 at this point. And, as far as I can tell, <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>chart.getLegend()</pre> <br />
<br />
does not contain any methods that give me the number of entries.<br />
<br />
If anyone has any other ideas to try, I would greatly appreciate it.<br />
<br />
Craig