|
CDMLTable spacing problem |
Posted by Nick on Dec-04-2010 04:07 |
|
Take a look at the attached images. When creating charts with more than a certain number of bars, the height of the table suddenly increases and it bumps down the labels. Any idea why this is happening and how I can prevent it?
Here is the code for creating the table:
CDMLTable labelTable = chrtReport.xAxis().makeLabelTable();
for(int i = 1; i < yearNames.Length - 1; i = i + 3)
{
labelTable.setCell(i, 0, 2, 1, yearNames[i]);
}
ChartDirector.TextBox style = labelTable.getStyle();
style.setFontSize(fontSize);
style.setFontStyle(font);
style.setBackground(Chart.Transparent, 0, 0);
The spaces between the pairs of bars in the charts are created by adding 0s to each of the arrays for the 5 bands in the stacked chart. If there were a way to split the cell under each of the empty bars into two and merge them with the label cells (so there's more space to expand before wrapping), I would be interested in that, too.
Thanks!
Nick
|
Re: CDMLTable spacing problem |
Posted by Nick on Dec-04-2010 04:40 |
|
OK, so it seems as if the row height thing was a bug which is fixed with the 5.0.2 release, so please disregard that part of my question.
I'm still interested in a way to make use of those cells under the empty bars to give my labels a little more space before they have to wrap.
Thanks for the help,
Nick |
Re: CDMLTable spacing problem |
Posted by Peter Kwan on Dec-06-2010 18:07 |
|
Hi Nick,
For your case, instead of asking ChartDirector to create an empty axis table based on the x-axis labels, and then fill the cells using setCells, you may consider to create a free floating table using BaseChart.addTable, and put it under the x-axis. If there are 4 bar groups, you can create a table with 4 cells. In this way, you can get rid of the empty cells.
You can configure the column width so that the width of the table is the same as the plot area width. To configure column width, you may use CDMLTable.getColStyle to get the TextBox object representing the column, and then call Box.setWidth to set the column width.
Hope this can help.
Regards
Peter Kwan |
|