Exception after upgrading to the latest version 4.2022.4.26
Exception after upgrading to the latest version 4.2022.4.26
Hi,
After upgrading the teechart control to the latest version available (4.2022.4.26) from version (4.1.2014.12153) i'm getting an exception originating from teechart control i didn't had before:
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=The parameter value must be greater than zero.
Parameter name: emSize
Source=PresentationCore
StackTrace:
at System.Windows.Media.FormattedText.ValidateFontSize(Double emSize)
at System.Windows.Media.FormattedText.InitFormattedText(String textToFormat, CultureInfo culture, FlowDirection flowDirection, Typeface typeface, Double emSize, Brush foreground, NumberSubstitution numberSubstitution, TextFormattingMode textFormattingMode, Double pixelsPerDip)
at Steema.TeeChart.WPF.Drawing.ChartFont.GetDrawingText(String text)
at Steema.TeeChart.WPF.Drawing.Graphics3DWPF.MeasureString(ChartFont f, String text)
at Steema.TeeChart.WPF.Drawing.Graphics3D.TextWidth(String text)
at Steema.TeeChart.WPF.Chart.bph(DrawingContext jkq, Boolean jkr)
at Steema.TeeChart.WPF.TChart.Draw(DrawingContext g)
at System.Windows.UIElement.Arrange(Rect finalRect)
This seems to be related to this issue:
http://support.steema.com/viewtopic.php ... 9587b8fb4e
but sadly I didn't find any solution or hint to the underlying problem in that post.
Can you please advise?
After upgrading the teechart control to the latest version available (4.2022.4.26) from version (4.1.2014.12153) i'm getting an exception originating from teechart control i didn't had before:
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=The parameter value must be greater than zero.
Parameter name: emSize
Source=PresentationCore
StackTrace:
at System.Windows.Media.FormattedText.ValidateFontSize(Double emSize)
at System.Windows.Media.FormattedText.InitFormattedText(String textToFormat, CultureInfo culture, FlowDirection flowDirection, Typeface typeface, Double emSize, Brush foreground, NumberSubstitution numberSubstitution, TextFormattingMode textFormattingMode, Double pixelsPerDip)
at Steema.TeeChart.WPF.Drawing.ChartFont.GetDrawingText(String text)
at Steema.TeeChart.WPF.Drawing.Graphics3DWPF.MeasureString(ChartFont f, String text)
at Steema.TeeChart.WPF.Drawing.Graphics3D.TextWidth(String text)
at Steema.TeeChart.WPF.Chart.bph(DrawingContext jkq, Boolean jkr)
at Steema.TeeChart.WPF.TChart.Draw(DrawingContext g)
at System.Windows.UIElement.Arrange(Rect finalRect)
This seems to be related to this issue:
http://support.steema.com/viewtopic.php ... 9587b8fb4e
but sadly I didn't find any solution or hint to the underlying problem in that post.
Can you please advise?
- Attachments
-
- exception.zip
- (1.63 KiB) Downloaded 479 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Exception after upgrading to the latest version 4.2022.4.26
Hello,
we're sorry to read you are experiencing this problem. At the end of the thread you refer to, you can read that we weren't successful in resolving the issue on these forums and got in touch directly with the client. Unfortunately, although the offer we made to the client in order that they could help us identify the problem was accepted, the client never got back to us with any results, despite our gentle reminders for them to do so.
I've just updated all our .NET Framework WPF examples (here I'm assuming you're using .NET Framework and not .NET 5/6) as you can see here. I've run all the examples in that folder using v.4.2022.4.26 but have not been able to reproduce your problem. Can you reproduce your problem using these examples? If not, could you please consider modifying one of these examples so we can reproduce this issue here?
we're sorry to read you are experiencing this problem. At the end of the thread you refer to, you can read that we weren't successful in resolving the issue on these forums and got in touch directly with the client. Unfortunately, although the offer we made to the client in order that they could help us identify the problem was accepted, the client never got back to us with any results, despite our gentle reminders for them to do so.
I've just updated all our .NET Framework WPF examples (here I'm assuming you're using .NET Framework and not .NET 5/6) as you can see here. I've run all the examples in that folder using v.4.2022.4.26 but have not been able to reproduce your problem. Can you reproduce your problem using these examples? If not, could you please consider modifying one of these examples so we can reproduce this issue here?
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: Exception after upgrading to the latest version 4.2022.4.26
Our application is far more complex than a simple view as you have in your examples. And yes, we are suing .NET Framework 4.7
Before trying to reproduce this on a sample application, can you maybe advise me based on the supplied stack-trace and the source code for tee-chart what may cause this type of behavior?
Did we miss some property for the control that leaves the emSize for text as zero?
What type of properties directly affect emSize for the control?
We are using: Chart.Aspect.TextFormattingMode = TextFormattingMode.Ideal; unsure if its related.
Before trying to reproduce this on a sample application, can you maybe advise me based on the supplied stack-trace and the source code for tee-chart what may cause this type of behavior?
Did we miss some property for the control that leaves the emSize for text as zero?
What type of properties directly affect emSize for the control?
We are using: Chart.Aspect.TextFormattingMode = TextFormattingMode.Ideal; unsure if its related.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Exception after upgrading to the latest version 4.2022.4.26
Hello,
The Font.Size property does. The last TeeChart method called in the stack trace is GetDrawingText, which looks like this: If the Size is zero it will produce the error, but we do not set Size to zero anywhere in the TeeChart.WPF source code. One way to workaround this issue would be to check for zero every time this method is called, but this doesn't really get to the bottom of the issue, which is what is setting Size to zero in the first place. We would be interested in understanding the issue here, and if you're willing we could offer you temporary access to the TeeChart source-code so you could see for yourselves where this zero assignment is being made.
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: Exception after upgrading to the latest version 4.2022.4.26
Ok, now that i understand the problem (font.size=0) somewhere in my code, i need to be able to understand which font.size is causing the issue.
I checked for example, the main TChart.FontSize and the Header font. and i saw that while the exception happens they are non-zero values.
How can i pinpoint which font instance exactly is zero value?
I checked for example, the main TChart.FontSize and the Header font. and i saw that while the exception happens they are non-zero values.
How can i pinpoint which font instance exactly is zero value?
Re: Exception after upgrading to the latest version 4.2022.4.26
Ok, got some further details:
it appears that the font that has a value of font of the Graphjics3D font is zero.
What affects this value, and how can i change its value?
it appears that the font that has a value of font of the Graphjics3D font is zero.
What affects this value, and how can i change its value?
- Attachments
-
- Capture.PNG (27.02 KiB) Viewed 10211 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Exception after upgrading to the latest version 4.2022.4.26
That Size is the Size I was referring to in my last message. What is of interest, to us, is understanding how this Size comes to be zero, especially given that in previous versions of TeeChart it did not happen (all client code being equal).
There is no universal way to change this value. The Graphics3DWPF is a 'painter', and paints all objects passed to it, many of which have Font properties of their own. So, for example, the Header class has a Font property, and when instantiated and the Chart is rendered, this Font property is assigned to the Graphics3DWPF.Font and the object is rendered. This means that client code may inadvertently be setting an Chart object's Font.Size to zero (e.g. that of the Header, the Axes, the Legend, etc. etc.) and it is this zero-sized Font.Size which is then assigned to Graphics3DWPF.Font which then causes the error when rendered.
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: Exception after upgrading to the latest version 4.2022.4.26
But how can we pin-point which font instance (header/footer/etc) is causing the problem?
Can I set a default value for all font sizes that isn't zero for all font instances?
Was the font-size behavior changed in recent versions of teechart with a default value of zero for fonts compared with previous versions (that maybe had a nonzero default values) ?
I already tried finding all of the places we set the font size explicitly, and non of them had a non-zero value, so i assume the problematic place is somewhere that is taken a default value.
Can I set a default value for all font sizes that isn't zero for all font instances?
Was the font-size behavior changed in recent versions of teechart with a default value of zero for fonts compared with previous versions (that maybe had a nonzero default values) ?
I already tried finding all of the places we set the font size explicitly, and non of them had a non-zero value, so i assume the problematic place is somewhere that is taken a default value.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Exception after upgrading to the latest version 4.2022.4.26
As I mentioned earlier, we do not set any Font.Size to zero anywhere in the Chart source code.
All our Chart primitives (Header etc.) are all already set to non-zero Font.Sizes. How to pin-point what is going on would be much easier with the Chart source-code, and as I said, I believe we'd be able to offer you temporary access to it in order to track down exactly where the problem is.
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: Exception after upgrading to the latest version 4.2022.4.26
Ok, so I'm waiting for the source-code for the chart
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Exception after upgrading to the latest version 4.2022.4.26
I will get in touch with the sales department who will send you an email to the email address associated with your account on these forums.
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: Exception after upgrading to the latest version 4.2022.4.26
Ok, this is getting really weird.
I've downloaded the source code for version 4.2022.2.11 compiled it myself with VS2022 (for .NET 4), replaced the assemblies in our project, and tried to reproduce the issue.
And to my complete surprise, everything works!
I then thought, maybe it is something with the recent version (4.2022.4.26), so i downloaded the compiled nuget for version (4.2022.2.11), and tried again, and sure enough, the emSize exception came back.
Just to make sure it was not a 'fluke', I again used the compiled assemblies I've compiled myself, and again, it simply worked.
How do you suggest we proceed?
I've downloaded the source code for version 4.2022.2.11 compiled it myself with VS2022 (for .NET 4), replaced the assemblies in our project, and tried to reproduce the issue.
And to my complete surprise, everything works!
I then thought, maybe it is something with the recent version (4.2022.4.26), so i downloaded the compiled nuget for version (4.2022.2.11), and tried again, and sure enough, the emSize exception came back.
Just to make sure it was not a 'fluke', I again used the compiled assemblies I've compiled myself, and again, it simply worked.
How do you suggest we proceed?
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Exception after upgrading to the latest version 4.2022.4.26
As you might have read on the other thread there is always the possibility that our obfuscation is causing an unwanted side-effect.
What I suggest therefore is that you run your code with the equivalent NuGet to the source-code, which is this one. Does this NuGet work with your code without the error?
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: Exception after upgrading to the latest version 4.2022.4.26
As I stated in my original post, I've already performed that test, and used the equivalent NuGet to the source-code, and got the same exception.
Only when using the code that I've compiled locally, It was working as intended.
Only when using the code that I've compiled locally, It was working as intended.
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: Exception after upgrading to the latest version 4.2022.4.26
Ah yes, sorry, I missed that.
I've just sent you an email with a link to a rebuild of the v.4.2022.2.11 assemblies but without either obfuscation or signing. Please let us know whether these assemblies also give you the same error or not.
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 |