Annotation tool drawing order
Posted: Thu Jul 03, 2014 9:57 am
Hi, i'm using Cursor tool and annotation tool and color line tool in my programm. I use AfterDrawEvent to annotation and some extra objects on the chart. Here's the the functions that acts on AfterDraw
Here tckMark.GeniuneTickMark is color line tool, DrawtickMarkLabel(g, tckMark.GeniuneTickMark), PointTickMarkIntersections(g, tckMark.GeniuneTickMark), DrawCursorToolMarks( g ) - draws text and circles on the chart, and MakeAnnotationForCursorTool() is used to fill annotation with text. So in my opinion the order of drawing is such, that anootation tool must be drawn the last one, and be the "top most" one the image, but i can see, that circles and text are drawn later than annotation tool. so i get the picture attached. What should i do to make annotation tool to be drawn the last one?
Code: Select all
private void OnAfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
foreach (TickMark tckMark in m_TickMarksList )
{
if (tckMark.Value > TimeAxis.Minimum && tckMark.Value < TimeAxis.Maximum)
{
g.Font.Color = Color.Black;
tckMark.GeniuneTickMark.Active = true;
DrawtickMarkLabel(g, tckMark.GeniuneTickMark);
PointTickMarkIntersections(g, tckMark.GeniuneTickMark);
}
else
tckMark.GeniuneTickMark.Active = false;
}
if (m_LevelHelper != null)
{
DrawLevelLabel(g, m_LevelHelper);
}
if( m_TChart.Tools.IndexOf( m_CursorTool ) != -1 )
{
DrawCursorToolMarks( g );
MakeAnnotationForCursorTool();
}
if (m_ChartZoomed)
{
Helper.RecaclulateAxisIncrement(5, TimeAxis);
}
}