Hello,
I have a Bar chart. I am trying to show text in Annotation tool in the same position as the Mark object. But the position of the Annotation is not in the center of the bar.The following code I am using to set the position of the annotation.
oMarks = oChart.Series(0).GetMarks();
oMarks.SetVisible(TRUE);
oChart.GetEnvironment().InternalRepaint();
long lIndex = oChart.GetTools().Add(tcAnnotate);
oAnnotationTool = oChart.GetTools().GetItems(lIndex).GetAsAnnotation();
oAnnotationTool.SetPositionUnits(ewuPixels);
oAnnotationTool.SetText(sTitle);
oShape = oAnnotationTool.GetShape();
oMarkPositions = oMarks.GetPositions();
oMarkPosition = oMarkPositions.GetPosition(lSeriesIndex);
oPoint = oMarkPosition.GetLeftTop();
long lLeftX = (long)oPoint.GetX();
long lTopY = (long)oPoint.GetY();
long lWidth = oMarkPosition.GetWidth();
long lHeight = oMarkPosition.GetHeight();
oShape.SetCustomPosition(TRUE);
oShape.SetLeft(lLeftX);
oShape.SetTop(lTopY);
oShape.SetShadowSize(0);
oMarks.SetVisible(FALSE);
Using Annotation in place of Mark object
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |