Fix bar width in stacked bar chart

2 posts, 0 answers
  1. Melvin
    Melvin avatar
    12 posts
    Member since:
    Dec 2011

    Posted 15 Feb 2012 Link to this post


    I have a simple question.

    How do I fix the width of each bar item in a stacked bar chart?

    In other words, I don't want it to be auto-scaled whenever there are more bar items added in the chart. Rather, a scroll bar should be visible to allow user to drag it for better viewability.

    For instance, if the x-axis allows 10 bars to be allocated. If only 2 bar items exist, then the remaining 8 will be empty (not scaled).

    Thanks and regards,
    Melvin Liew
  2. Nikolay
    Nikolay avatar
    395 posts

    Posted 20 Feb 2012 Link to this post

    Hello Melvin,

    Generally, there are two properties used for controlling the width of bar items - ItemWidthPercent and ItemOverlapPercent. Please note that these are properties of the ChartArea, so they would affect all series. You can find more information and examples in this help topic.

    As for using a scroll bar, you could enable it through ZoomScrollSettingsX. Setting specific RangeStart and RangeEnd values would affect the range being displayed on the axis. Additional information is available here.

    When you have values that are not always present, as described in your example, you could use the EmptyValues feature's Gap behavior and setting a manual axis range. You can find such an example in our demo.

    All the best,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Back to Top