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

Message ListMessage List     Post MessagePost Message

  Labels on Gantt Chart
Posted by Leonard on Mar-25-2009 09:35
Using the Multicolor Gantt Chart as a starting point, (and eliminating the Milestone symbols) how can I add a label (<10 Char) to  each bar, including the case when there are more than one bar per horizontal line. I would like the label located a few pixels after the bar.

I have tried several approaches, but nothing is working for me.

Thank You,  Leonard

  Re: Labels on Gantt Chart
Posted by Peter Kwan on Mar-26-2009 07:49
Hi Leonard,

If the label is outside the bar, you may use another layer to add the labels. For example, in VB/VBScript, it is like:

'a transparent scatter layer to mark the label position (at the endDate side)
Set labelLayer = c.addScatterLayer(taskNo, endDate, "", cd.SquareSymbol, 1,Transparent, cd.Transparent)

'myLabels is the array containing the labels for the bars
Call labelLayer.addExtraField(myLabels)
Call labelLayer.setDataLabelFormat("{field0}")

'put the labels on the right side (left aligned to the endDate)
Call labelLayer.setDataLabelStyle("arial.ttf", 8).setAlignment(cd.Left)

Hope this can help.

Regards
Peter Kwan