We develop an application in .Net 3.5 in VS 2010 c#, using TeeChart Pro v 3.5.3225.32185.
We have a function need the method:Tchart.Graphics3D.TextOut(10,5,"ABC").
But in the last two month wo have a exception about this twice,the log is:
System.ArgumentException: Parameter is not valid.
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, Single x, Single y, StringFormat format)
at Steema.TeeChart.Drawing.Graphics3DGdiPlus.DoDrawString(Int32 x, Int32 y, String text, ChartBrush aBrush)
at Steema.TeeChart.Drawing.Graphics3D.TextOut(ChartFont f, Int32 x, Int32 y, String text)
at Steema.TeeChart.Drawing.Graphics3D.TextOut(Int32 x, Int32 y, String text)
And this is also hardly to be reproduced.We guess it maybe the Tchart has disposed the parameter which the DrawString need ,maybe is ChartFont.
So please to help to fixed this issue.
Thanks!
"Parameter is not valid" happened in TextOut() method
Re: "Parameter is not valid" happened in TextOut() method
Hello Sim,
The problem is you need draw the Chart before use method TextOut. I have made a simple code that works fine for me and I think you can use to solve your problem, see next:
Can you tell us if previous code works as you expect?
I hope will helps.
Thanks,
The problem is you need draw the Chart before use method TextOut. I have made a simple code that works fine for me and I think you can use to solve your problem, see next:
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart2.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(tChart2_AfterDraw);
}
void tChart2_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
tChart2.Graphics3D.TextOut(10, 5, "ABC");
}
I hope will helps.
Thanks,
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 |
Re: "Parameter is not valid" happened in TextOut() method
Hello Sandra,
Thanks for your advice. I will try and hope the issue would be fixed.
Thanks for your advice. I will try and hope the issue would be fixed.
Re: "Parameter is not valid" happened in TextOut() method
Hello sim,
I hope it, will be solved your problem .
Thanks,
I hope it, will be solved your problem .
Thanks,
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 |