Jump to content
Software FX Community

Gantt chart with PointLabels at different positions


Nicolas Bougeard

Recommended Posts

 Hello,

 I'm trying to develop a Gantt chart in which every bar will display a label. The X-axis (actually the Y-axis because axis are inverted in gantt chart) is the timeline but it is fixed to Min = Today - 14 days and Max = Today + 14 Days

This label can contain different data so I set the Point.Tag property in code-behind and use PointLabels (with Mask = "%L") to display it.

This method works fine to display the data but the thing is that, because of the fixed dates, the bars can touch the right (or left) border of the chart.

 So far, I've tried 2 things :

- Setting the Chart.PointLabelOffset to place the label next to the bar (see first attachment)

- Setting the Chart.PointLabelAlign to LabelAlign.Center Or LabelAlign.VCenter (see second attachment and don't pay attention to the color of the text)

The first one works fine except for bars touching the right border of the chart.

The second one works fine with long bars but is really ugly for short ones.

 

I've also tried to modify this 2 properties for each point, depending of the position and length of the bars, but I've encountered some problems. I didn't manage to find the PointLabelOffset property for the Point class (only available for the chart). Setting different LabelAlign to different points result in weird alignment and doesn't fix the problem.

 I'm using URL links on the bars too, and for some reason it didn't workwith a chart rendered with HtmlTag="Auto" so I used an image rendering(HtmlTag="Image") and the links work fine. So it may change thebevahiour, I don't know.

 

Does somebody know a way to help me ? Maybe there's a way to automatically put the label where there is enough space.

 

Thanks, 

Nicolas

 

post-5675-13922409659386_thumb.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...