Page 1 of 1

Is there a tool to draw shapes on a chart?

Posted: Wed Jan 21, 2009 7:04 pm
by 14049416
I have a chartwith a candle series. My employer wants me to add the capability to draw circles and ellipses on the candle chart. Is there such a tool?

Posted: Thu Jan 22, 2009 11:33 am
by 10050769
Hi WD_Gordon!

I propos one solution, you can help.

You, can use events OnMouseUp, and OnMouseDown as next exemple:

OnMouseDown

Code: Select all

        private void tChart1_MouseDown(object sender, MouseEventArgs e)
        {
            Steema.TeeChart.Styles.Shape sh = new Steema.TeeChart.Styles.Shape(tChart1.Chart);
            sh.Style = ShapeStyles.Circle;
            sh.Transparent = true;
            sh.X0 = tChart1.Axes.Bottom.CalcPosPoint(e.X);
            sh.Y0 = tChart1.Axes.Left.CalcPosPoint(e.Y);

        }
OnMouseUp

Code: Select all

        private void tChart1_MouseUp(object sender, MouseEventArgs e)
        {
            
            ((Steema.TeeChart.Styles.Shape)tChart1[tChart1.Series.Count - 1]).X1 = tChart1.Axes.Bottom.CalcPosPoint(e.X);
            ((Steema.TeeChart.Styles.Shape)tChart1[tChart1.Series.Count - 1]).Y1 = tChart1.Axes.Left.CalcPosPoint(e.Y);
            tChart1[tChart1.Series.Count - 1].Repaint();
        }
You needs assign X0,Y0,X1,Y1 values,because you does not draw correct circle. If you would draw an ellipse, you just have to draw the circle lying.

Thanks,

Best Regards
Sandra Pazos



Steema Support Central
http://support.steema.com