Resize chart inside docking panel

5 posts, 1 answers
  1. Rory
    Rory avatar
    159 posts
    Member since:
    Jul 2007

    Posted 18 Jan 2012 Link to this post

    Hi I have a Horizontal Bar Chart inside a docking panel.
    I would like the height of the chart to get bigger as we get more items or as we resize the panel. The width works fine and adjusts its self depending on the width of the panel but the height is always the same height. Please Help. The only workaround I can think of is to count how many items are in the datasource for the xaxis and calculate a height but then it will remiain static as the panel is resized.
    Thanks.
  2. Rahul
    Rahul avatar
    116 posts
    Member since:
    Feb 2011

    Posted 20 Jan 2012 Link to this post

    Hi Rory,
     
              I also same issue when gridview is in tileview.
    Its not taking height automatically.

    Please refer below link which may help you.
    http://www.telerik.com/community/forums/silverlight/tileview/scrolls-for-grid-inside-tileview.aspx


    Thanks & Regards
    Rahul
  3. DevCraft banner
  4. Answer
    Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 23 Jan 2012 Link to this post

    Hi Rory,

    1. I would like the height of the chart to get bigger as we resize the panel
    I have attached a small project that demonstrates that the chart is being resized accordingly in both directions. When I resize the window - both the width and height of the chart are changed correctly to fit the dock panel. May be you have set height somewhere in your code and this is why you get such results. 

    2. I would like the height of the chart to get bigger as we get more items.
    The only way to achieve this is manually - when the chart is populated to calculate the new desired size of the chart. There is no way for the chart to know what is the appropriate height for your items.

    Regards,
    Petar Marchev
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  5. Rory
    Rory avatar
    159 posts
    Member since:
    Jul 2007

    Posted 23 Jan 2012 Link to this post

    Thanks Peter for the basic example. We unfortunately are unable to take this simplistic approach because we need the chart to be a bit more dynamic and grow in height with the number of axis items. We also need the RadDockingPanel to become scrollable when the chart grows too large which seems to be linked to why the chart doesn't resize. Without scrolling once the number of items increases too much the chart becomes squeezed inside the panel and unreadable. We are doing a simple calculation like so to set our height. 
    Take Care.

    double chartHeight = (list.Count * heightPerItem) + minChartHeight; 
    ClaimChart.Height = chartHeight;
  6. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 26 Jan 2012 Link to this post

    Hello,

    Have you tried to wrap the chart in a scroll viewer?

    If you keep experiencing problems with this you can create a small project that demonstrates the issue and send us the code so that we can see how you have structured the elements and get back to you with our feedback based on the code.

    Regards,
    Petar Marchev
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top
DevCraft banner