Resizing plot area

Thread is closed for posting
2 posts, 0 answers
  1. Oskar
    Oskar  avatar
    4 posts
    Member since:
    Apr 2007

    Posted 21 Sep 2007 Link to this post


    I am trying to resize the plot area in order to prevent the legend overlapping the chart. Since longer texts in the legend takes up more space i try to set the right margin of the plot area to the width of the legend.

    I am trying achiev that by this line of code:
    chartTrend.PlotArea.Appearance.Dimensions.Margins.Right.Value = chartTrend.Legend.Appearance.Dimensions.Width.Value + 35;

    The problem is that chartTrend.Legend.Appearance.Dimensions.Width.Value always is zero!

    Is this the best approach or is there another way of resizing the plot area so it will not be overlapped by the legend?
  2. Kiril
    Kiril avatar
    158 posts

    Posted 24 Sep 2007 Link to this post

    Hello Oskar ,

    Thank you for this useful feature request. Currently, there is no automated way to make sure that the legend does not overlap with the plot area. In the future, however, we plan to support this feature.

    In order to get this functionality right now with the latest version of RadChart, you can set the right margin of the PlotArea of the RadChart using the Property builder. Select the RadChart control, and navigate in the property builder to

    PlotArea > Appearance > Dimensions > Margins

    Set the right margin to an absolute value (in pixels) which would approximate the width of your legend. You may have to run your application a few times to arrive at a good value so that the plot area would be pushed far enough to the left so that it will not overlap with the legend .

    Thank you for your time. If you have any additional questions, don't hesitate to contact us.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top