DrawLine tool works strange
Posted: Fri May 04, 2007 9:59 am
For building financial type charts we use custom vertical axes to have both left and right axes and place one chart under another. Everything works as expected.
Our application requires an ability to place a custom line on chart. To accomplish that we use DrawLine tool and the following code:
As a result sometimes line does not show up at all, sometimes it shows up but does not allow to resize.
Sometimes lines are now shown, but when chart is saved and opened from file lines are shown.
Please advise.
Our application requires an ability to place a custom line on chart. To accomplish that we use DrawLine tool and the following code:
Code: Select all
DrawLine drawLine = new DrawLine(TeeChart.Chart);
drawLine.EnableDraw = false;
DrawLineItem item = new DrawLineItem(drawLine);
double startX = TeeChart.Axes.Bottom.Minimum + 10;
double startY = TeeChart.Axes.Left.Minimum + 10;
double endX = TeeChart.Axes.Bottom.Maximum - 10;
double endY = TeeChart.Axes.Left.Maximum - 10;
item.StartPos.X = startX;
item.StartPos.Y = startY;
item.EndPos.X = endX;
item.EndPos.Y = endY;
drawLine.Invalidate();
Sometimes lines are now shown, but when chart is saved and opened from file lines are shown.
Please advise.