[CLOSED] Line chart getting shrink, due to legend box Height

  1. #1

    [CLOSED] Line chart getting shrink, due to legend box Height

    Hi,

    I have a line chart, which displays countries and its revenue, the issue i am facing is that, when there are too many countries the chart height get shrink, due to legend box, as there are many countries displayed in legend, it occupies the chart height.

    For example if the chart height is 700, it is rendered as 500 Chart Height+200 Legend box height, that's why chart get shrink. How can i make chart height 700 excluding legend height.

    Below sample image will give you clear idea:



    Thanks
    Attached Thumbnails Click image for larger version. 

Name:	Untitled.jpg 
Views:	39 
Size:	95.1 KB 
ID:	10551  
    Last edited by Daniil; May 08, 2014 at 10:01 AM. Reason: [CLOSED]
  2. #2
    Quote Originally Posted by PriceRightHTML5team View Post
    For example if the chart height is 700, it is rendered as 500 Chart Height+200 Legend box height, that's why chart get shrink. How can i make chart height 700 excluding legend height.
    How about just increase the Height of Chart to 900?
    Geoffrey McGill
    Founder
  3. #3
    Quote Originally Posted by geoffrey.mcgill View Post
    How about just increase the Height of Chart to 900?
    Thanks for reply..

    I want to set dynamic height to chart, for too many countries 900 Chart height is OK, but in case when there are 2-3 countries chart height will unnecessary get increased.

    Is there any way to calculate or assign dynamic height to chart as per the legend items?

    Something like this:
    Chart height= 700 + Dynamic height of legend box.
  4. #4
    I think you can get the dynamic height of legend box after layouting (I would try an AfterLayout listener with Buffer="50" of a container which contains the Chart):
    legendElement.getHeight();
    Then set the new height for the Chart:
    chart.setHeight(700 + legendHeight);
  5. #5
    Thanks Daniil...

    It is working fine.

Similar Threads

  1. [CLOSED] Stacked Chart Legend with categories on more than one line
    By csfesta in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 06, 2014, 5:48 AM
  2. [CLOSED] Dotted line renders as solid line in line chart image
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 01, 2014, 5:28 PM
  3. [CLOSED] Chart shrinks when legend size increases
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 22, 2014, 8:10 AM
  4. [CLOSED] Configure Legend of Line Chart Series
    By PriceRightHTML5team in forum 2.x Legacy Premium Help
    Replies: 31
    Last Post: Oct 19, 2013, 4:32 AM
  5. Replies: 2
    Last Post: Aug 13, 2012, 2:12 PM

Posting Permissions