Hello!
I've got a crash after exporting TChart to XAML, bacause XAML contains Infinity and NaN coordinates. TChart version Steema TeeChart for .NET 2016 4.1.2016.10260.
Sample is attached. You need only change TeeChart.WPF reference to valid file.
Start project and click on "Export to XAML and read..." button.
TChart crash after XAML export
TChart crash after XAML export
- Attachments
-
- TChartTest.zip
- (21.09 KiB) Downloaded 732 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: TChart crash after XAML export
Hello,
The following code:
exports to file correctly. If I then copy and paste the canvas into a new Xaml page I obtain this:
I then modify the code to this:
And the XamlReader loads the stream correctly.
I think the issue is with using a Width and Height which is not big enough for all the elements you have in your chart.
The following code:
Code: Select all
private void Button_Click(object sender, RoutedEventArgs e)
{
Steema.TeeChart.WPF.Export.XAMLFormat xaml = MyTChart.Export.Image.XAML;
xaml.Width = 400;
xaml.Height = 300;
xaml.Save(@"G:\temp\chart.xaml");
}
I then modify the code to this:
Code: Select all
private void Button_Click(object sender, RoutedEventArgs e)
{
Steema.TeeChart.WPF.Export.XAMLFormat xaml = MyTChart.Export.Image.XAML;
xaml.Width = 400;
xaml.Height = 300;
MemoryStream ms = new MemoryStream();
xaml.Save(ms);
ms.Position = 0;
object exportedXaml = XamlReader.Load(ms);
}
I think the issue is with using a Width and Height which is not big enough for all the elements you have in your chart.
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: TChart crash after XAML export
Hello Christopher!
Thank you, but I'll think this problem is more global. I only made a sample to reproduce crash.
1. This sample works correctly with WPF TChart version 4.1.2015.3112, you can check. No crash!! Please check this sample with version 4.1.2015.3112.
2. After upgrade from version 4.1.2015.3112 to 4.1.2016.10260 I've got a lot of crashes because of Infinity and NaN values in exported XAML. A lot of! I created this sample only to show you that coordinate values in XAML shouldn't be Infinity and NaN, because it's impossible to read such XAML.
Thank you, but I'll think this problem is more global. I only made a sample to reproduce crash.
1. This sample works correctly with WPF TChart version 4.1.2015.3112, you can check. No crash!! Please check this sample with version 4.1.2015.3112.
2. After upgrade from version 4.1.2015.3112 to 4.1.2016.10260 I've got a lot of crashes because of Infinity and NaN values in exported XAML. A lot of! I created this sample only to show you that coordinate values in XAML shouldn't be Infinity and NaN, because it's impossible to read such XAML.
Re: TChart crash after XAML export
Hello Christofer!
I made another sample without Width and Height set. It crashes!
Please check.
I made another sample without Width and Height set. It crashes!
Please check.
- Attachments
-
- TChartTest.zip
- (21.26 KiB) Downloaded 676 times
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: TChart crash after XAML export
Hello,
I see, thank you for the information! I have now been able to reproduce the issue and have added to our issue tracker with id=1720.bmb wrote: 1. This sample works correctly with WPF TChart version 4.1.2015.3112, you can check. No crash!! Please check this sample with version 4.1.2015.3112.
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 |