Unable to set the width of the chart bars

5 posts, 0 answers
  1. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 09 Dec 2010 Link to this post

    Hi, I have a bar chart and this is placed in a scrollviewer as we need the ability to support smaller screen resolutions. I want to force the maximum width of each bar. I have placed a custom style for the X-Axis labels but the chart does not change the width of space the bars use. I can changed the width of the text. I have attached a screen shot and what I want to acheive is that each entry is closer together.

    Thanks
    P
  2. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 09 Dec 2010 Link to this post

    If I remove the scrollbar then the content is adjusted to a reasonable size. So i basically want to force this size however having the ability to scroll should there be more values.
  3. DevCraft banner
  4. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 09 Dec 2010 Link to this post

    As you can see if you dont use a scrollviewer then on a smaller resolution the chart is unreadable.
  5. Jason Best
    Jason Best avatar
    5 posts
    Member since:
    Dec 2007

    Posted 13 Dec 2010 Link to this post

    If you know the number of individual bars that are going to be in the chart, you can simulate this by manually setting the width of the overall chart (or would that be height for your case, since you're using a horizontal bar chart?).  Say you want each individual bar to be 20 pixels wide. Assuming there would be about 5 pixels inbetween, I would set the width of the entire chart to be (20 * numBars) + (5 * numBars). If you're having to account for the size of the legend, tack on another +20 there.

    Unfortunately, that really only helps if you know the number of bars that are going to be in the chart.  Otherwise, there doesn't seem to be any specific variable to determine the width of the bars that I could find (it seems to just be relative to the size of the chart). Hope this helps.
  6. Yavor
    Admin
    Yavor avatar
    401 posts

    Posted 14 Dec 2010 Link to this post

    Hello madladuk,

    Bars' size is always represented as percent of the available plot area size. You can fix the bar's size by fixing the RadChart's size.

    Best wishes,
    Yavor Ivanov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top
DevCraft banner