This is a migrated thread and some comments may be shown as answers.

Fix bar width in stacked bar chart

1 Answer 143 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Melvin
Top achievements
Rank 1
Melvin asked on 15 Feb 2012, 11:25 AM
Hi,

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

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 20 Feb 2012, 08:39 AM
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,
Nikolay
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Chart
Asked by
Melvin
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or