views:

404

answers:

1

I have stacked bar chart in which the number of columns is dynamic, can change from 1 to n columns. I want the spacing between the charts and width of the bar to be consistent. How do I fix it. Please suggest solutions / ideas.

+1  A: 

StackedBarRenderer devotes some effort to making the "spacing between the [bars] and width of the bar to be consistent." It's not clear what you want it to do differently as the number of columns changes. The relevant geometry is determined by the parent BarRenderer in such methods as calculateBarWidth(), which can be overridden as desired. Also, verify that there is a value for each category in each series.

trashgod
I used setMaximumBarWidth method of renderer to set the width dynamically.
SKR
Excellent. I wasn't aware of `setMaximumBarWidth()`, and it looks much easier. I'd up-vote it as a separate answer.
trashgod