View Full Version : BarSeries Enhancement Request for Setting Gaps Between Bars / Columns

8 Nov 2011, 4:15 PM

I am working to replace a stacked column Flex chart with the same type of GXT 3.0 chart.

One requirement is to have no gap between the stacked vertical columns.

Flex column charts have an option to adjust the gap (as a percentage) between the stacked columns, including setting the gap to zero. However, if the browser window is resized to be a little wider horizontally, then sometimes a very thin vertical gap will show between some of the columns. I overcame this problem in the Flex chart by using a percentage value slightly less than zero (i.e., negative 2 percent).

In working with the GXT 3.0 BarSeries class, I could not find a similar method. But, I did notice the private properties “gutter” and “groupGutter” that are both set to 38.2 percent.

Since I could not change their values by extending the class, I made a copy of the entire BarSeries class (a bad thing I know), changed the values from 38.2 to negative 2 percent (per below), and found that the chart worked just fine with no gaps appearing between the columns when resizing the browser.

// The gutter space between single bars, as a percentage of the bar width
private double gutter = -02.0;

// The gutter space between groups of bars, as a percentage of the bar width
private double groupGutter = -02.0;

I first tried using zero in the BarSeries class, but the same problem occurred as with Flex in that occasionally very thin vertical gaps would show between some of the columns after resizing the browser to be a little wider horizontally.

So, my request is for there to be public or protected methods to get to these properties.

Please let me know if you can accommodate this request in the upcoming release.

John Lewis

9 Nov 2011, 11:00 AM
Sorry about that John. Occurred to me when you mentioned it at the conference. It is not in PR5, but has been added in revision 1829 and will be in the forthcoming beta release. Thanks for the heads up.

9 Nov 2011, 1:33 PM
Hi Brendan.

Thank you for accommodating this enhancement request.

It is greatly appreciated!

John Lewis