Nicolas Bougeard Posted May 27, 2009 Report Share Posted May 27, 2009 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 Quote Link to comment Share on other sites More sharing options...
Nicolas Bougeard Posted May 27, 2009 Author Report Share Posted May 27, 2009 For some reason, I didtn't manage to attach the 2 files at once, so here is the second one. Thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.