For example, I have a sales chart by item with teechart.
I want to add break-even point line on 450.
How can I implement it? I think it would be good if you give me a sample
Thank you.
How to draw multiple line without adding series?
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw multiple line without adding series?
Of course - you can find the sample I refer to below in the TeeChart for .NET C# Windows Forms examples repo under the 'Feature Demo' folder. The sample shows TeeChart's canvas events which allow you to draw lines, shapes, text and images at any point of the chart at different times of its painting routine:
Best Regards,
Christopher Ireland / 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 |
Re: How to draw multiple line without adding series?
Thanks for answering.
I could draw line with Graphics3D, Point.
but, I couldn't set 450 its line position dynamically regardless of chart size.
I could draw line with Graphics3D, Point.
but, I couldn't set 450 its line position dynamically regardless of chart size.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: How to draw multiple line without adding series?
You can fix the point by getting the Axis to calculate the pixel value of the Axis value for you, e.g.
Code: Select all
private void TChart1_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
var yVal = tChart1.Axes.Left.CalcPosValue(450);
g.Pen.Color = Color.Red;
g.HorizontalLine(tChart1.Chart.ChartRect.Left, tChart1.Chart.ChartRect.Right, yVal);
}
Best Regards,
Christopher Ireland / 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 |
Re: How to draw multiple line without adding series?
Thanks to you, we solved the problem.