When performing custom drawing in the TeeChart's Canvas, or in my case the AfterDraw event, I am allowing the user to drag the mouse and dynamically paint a Fibonacci Retracement.
My question is this, can I restrict the drawing to the series drawing area? Right now if the user drags over the value labels then it draws over the labels as well. I will like to keep the lines that I am drawing inside the actual chart area where my candles are displayed.
Thanks,
Kevin
Custom drawing using TeeChart's Canvas
Hi kevin!
Two things:
First:
In TeeChart exist the FibonacciTool, that paint Fibonacci Retracement, You could watch Demo "What's New?\Welcome !\New Chart Tools\Fibonacci Arcs" as exemple.
Second:
If solution first, not that you want You could do similar code as the exemple:
Event BeforeDrawValues
Event AfterDrawValues
I hope that you are help.
Two things:
First:
In TeeChart exist the FibonacciTool, that paint Fibonacci Retracement, You could watch Demo "What's New?\Welcome !\New Chart Tools\Fibonacci Arcs" as exemple.
Second:
If solution first, not that you want You could do similar code as the exemple:
Code: Select all
private void InitializeChart()
{
Steema.TeeChart.Styles.Candle candle1 = new Steema.TeeChart.Styles.Candle(tChart1.Chart);
candle1.FillSampleValues(20);
candle1.BeforeDrawValues += new Steema.TeeChart.PaintChartEventHandler(tChart1_BeforeDrawValues);
candle1.Chart[0].AfterDrawValues += new Steema.TeeChart.PaintChartEventHandler(tChart1_AfterDrawValues);
}
Event BeforeDrawValues
Code: Select all
private void tChart1_BeforeDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
g.ClipRectangle(tChart1.Chart.ChartRect);
g.Line(0, 0, tChart1.Width, tChart1.Height); //exemple
}
Event AfterDrawValues
Code: Select all
private void tChart1_AfterDrawValues(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
tChart1.Chart.Graphics3D.ClearClipRegions();
}
I hope that you are help.
Best Regards,
Sandra Pazos / 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 |