Actually the measure in this control goes the other way around -- there is some space available for the chart. So, the surrounding axes are placed inside and what's left is used by the chart area i.e. where the series are drawn. Now, if there are 3 categories, the bars will occupy relatively large portions of the space (horizontally) while for 23 categories, each of them will have less space. So, the chart provides each category with the available space. Then, there is a property on the CategoricalAxis -- GapLength. It takes a double number between 0 and 1, and its meaning is the relative part of the space which should not be occupied by bars (0.9 means only 10% of the space will be occupied by bars, while 0 means there are no gaps, so the chart would look like a histogram).
Now, let's consider the first case in your image. There is simply no room for 23 clusters, 3 bars each, 110 px for each bar. So the chart just displays all the data, but it needs to shrink the bar width in order to fit all the categories. On the other hand -- third case -- the chart has a strictly defined space for each category (based on the available space, zoom and number of categories) and places the bars inside. So, I am afraid my previous suggestion would serve only a limited number of cases. Unfortunately, the scenario you have described is not supported and a possible workaround would be to hook the ZoomChanged
event of RadCartesianChart (NB! It is only available in the Latest Internal Build) and calculate your own value for GapLength
, so that the bigger the zoom width, the wider gap length gets.
the Telerik team