Can by any mean i fix the width of a bar in a bar chart.
as if the number of bars are less ,then each bar takes enormous width whereas if the number of bars are more ,then all the bars shrinks to very small width.
can any one suggest me any fix for this .
ASAP.
1 Answer, 1 is accepted
0
Evgenia
Telerik team
answered on 11 Aug 2011, 09:34 AM
Hello Bishwajit,
RadChart is designed so that the bar width actually depends on the number of items. The more the items - the narrower the bars. This provides the necessary level of flexibility, so that the chart can handle multiple cases with minimum adjustments. Still, in cases like this one RadChart allows you to fix the bar width by fixing the XAxis range. You can use these two lines:
RadChart1.PlotArea.XAxis.AutoScale = false;
RadChart1.PlotArea.XAxis.AddRange(0, max, 1);
where max is defined by the max number of items in the underlying datasource. This way the X axis will always reserve space for max items, and even if there are less items in the chart the bars will not grow.