ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Chart title with tables
Posted by Eva on Aug-07-2012 22:47
Attachments:
Hi Peter,

Is it possible to add a couple of side-by-side tables of information to the chart title (two boxes just below the ?Main Chart Title?)? I would like the layout to look similar to the included example.
(I use Java)

Thank you,
Eva
Chart Layout.png

  Re: Chart title with tables
Posted by Peter Kwan on Aug-08-2012 03:14
Hi Eva,

By using BaseChart.addText to add custom text boxes, and use CDML to format the text, it should be possible to achieve what you need. A short example is like:

//add normal title
ChartDirector.TextBox t = c.addTitle("Annual Revenue for Star Tech", "Times New Roman Bold Italic", 18);

//add the left box below
int boxWidth = c.getWidth() / 2 - 4;
int margin = 10;

ChartDirector.TextBox b = c.addText(0, t.getHeight() + 4,
"<*block,width=" + (boxWidth - margin * 2) + ",halign=center*><*font=Arial Bold,size=14,color=FF0000*>Title 1<*/font*><*/*><*br*>Text 2<*br*>Text 3");
b.setSize(boxWidth, 0);
b.setBackground(Transparent, 0x888888);
b.setMargin2(margin, margin, margin, margin);

Hope this can help.

Regards
Peter Kwan