User (Legacy) Posted May 13, 2003 Report Share Posted May 13, 2003 Hi!Would like some help with a problem regarding annotation objects and Gantt charts.I'm using ASP to render the chart. The version of ChartFx is 184.108.40.206.I'm trying to print a explanatory text inside (or near) the bars in my Gantt chart.The chart consists of dates on the Yaxis.I've been trying to find an explanation in the help pages but unsuccessfully.The code below shows what I'm trying to do.The problem is to get the x and y coordinates for the annotation object.I've tried two alternatives, but none of them work. Alternative 1 results in x = null and y = null.Alternative 2 results in x = 763 and y = 0, for all values even though they should differ and none of them being 763. Can someone please explain to me what I'm doing wrong? Regards, Peter Krickner ... For i = 0 To (oChart.NValues - 1) 'Create a Text object Set ObjText = AnnotX.Add(6) '6 is a Text object 'Get the position for the annotation object 'Alternative 1 (x and y are out-, the rest are in-parameters): Call oChart.ValueToPixel(i, oChart.IniValueEx(0, i), CDbl(x), CDbl(y), 1) 'Alternative 2 (4 = CPI_VALUETOPIXEL): nMarkerPosition = oChart.PaintInfo(4, oChart.IniValueEx(0, i)) x = CHART_LOWORD(nMarkerPosition) y = CHART_HIWORD(nMarkerPosition) 'Set position for annotation object. ObjText.Top = x ObjText.Left = y 'Enter text ObjText.Text = "Text inside the Gantt bars" 'Set annotation object properties ObjText.Width = 200 ObjText.Height = 30 ObjText.BkColor = CHART_TRANSPARENT ObjText.Color = RGB(0,255,0) ObjText.AllowMove = False Set ObjText = Nothing Next Link to comment Share on other sites More sharing options...
This topic is now archived and is closed to further replies.