Hi Pat,
Sorry for the late reply.
I think for addTitle2, the width of the text box is configured by ChartDirector to be equal to the width of the chart (assuming the title is put at the top or bottom of the chart). You can see the width of the text box by configuring a background color for the text box. If you look at the sample code that comes with ChartDirector, if the title has a background color, it always fills the entire width of the chart, so the width of the title text box should be the same as the width of the chart.
If you want to have a text box in which the size varies based on the text, you may use BaseChart.addText. Alternatively, you may try to apply setWidth(0) to the text box returned from addTitle2. According to the ChartDirector documentation, this would set the width of the text box to be based on the length of the text.
Hope this can help.
Regards
Peter Kwan |