SubChart. Exporting to XAML

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
neurosoft
Newbie
Newbie
Posts: 14
Joined: Wed May 14, 2014 12:00 am

SubChart. Exporting to XAML

Post by neurosoft » Thu May 15, 2014 4:51 am

Hello steema!
I use SubChartTool to show SubTChart over the main TChart via the code like this:

Code: Select all

            Bar bar = new Bar();
            bar.Marks.Visible = false;
            bar.Add(5);            
            bar.Add(7);
            MyTChart.Series.Add(bar);

            SubChartTool subChartTool = new SubChartTool();
            MyTChart.Tools.Add(subChartTool);
            TChart subChart = subChartTool.Charts.AddChart(string.Empty);
            subChart.Aspect.View3D = false;            
            subChart.Panel.Color = Colors.Transparent;
            subChart.Walls.Visible = false;
            subChart.Axes.Visible = false;

            Pie subChartPie = new Pie();
            subChartPie.Marks.Visible = false;
            subChartPie.Add(10);
            subChartPie.Add(6);
            subChartPie.Brush.Color = Colors.Red;
            subChart.Series.Add(subChartPie);
It works for me.
SubChart.jpg
SubChart.jpg (41.29 KiB) Viewed 9575 times
But if I try to export this TChart to XAML:

Code: Select all

MyTChart.Export.Image.XAML.Save(saveDialog.FileName);
The result won't contain subchart data:
ExportedSubChart.jpg
ExportedSubChart.jpg (45.4 KiB) Viewed 9599 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: SubChart. Exporting to XAML

Post by Christopher » Thu May 15, 2014 2:36 pm

Hello,

I have been able to reproduce this defect and it has already been fixed.

As a workaround, you can export your chart to XAML with a SubChartTool using TeeChart.dll (WinForm TeeChart) and manually edit the XAML to remove the erroneously nested <Canvas> object.
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

neurosoft
Newbie
Newbie
Posts: 14
Joined: Wed May 14, 2014 12:00 am

Re: SubChart. Exporting to XAML

Post by neurosoft » Mon Aug 18, 2014 9:22 am

Hello steema!
I downloaded the last release of WPF TChart and checked if my problem is solved.
Now I can see a subchart in the exported xaml, but it has wrong background. I set transparent color to the subchart panel's background (subChart.Panel.Color = Colors.Transparent;) but exported xaml contains wrong rectangle:

Code: Select all

<Rectangle
 Canvas.Left="50" Canvas.Top="50" Width="151" Height="101">
 <Rectangle.Fill>
   <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
    <GradientStop Offset="0" Color="#FFEAEAEA"/>
    <GradientStop Offset="1" Color="#FFFFFFFF"/>
  </LinearGradientBrush>
 </Rectangle.Fill>
</Rectangle>
SubchartBackground.jpg
SubchartBackground.jpg (44.86 KiB) Viewed 9535 times
If I set StartColor and EndColor properties of subChart.Panel.Gradient to transparent, then the exported xaml will be ok. But it would be great if the source and exported TChart appear the same.

And finally, it seems that non-transparent value of subChart.Panel.Color property doesn't work in WPF TChart. If I set it to red, for example, then the subchart's background will be gradient of gray and white.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: SubChart. Exporting to XAML

Post by Sandra » Tue Aug 19, 2014 8:14 am

Hello neurosoft,
I downloaded the last release of WPF TChart and checked if my problem is solved.
Many thanks for your feedback. I am glad your problem is solved using latest Teechart.Net maintenance release.
Now I can see a subchart in the exported xaml, but it has wrong background. I set transparent color to the subchart panel's background (subChart.Panel.Color = Colors.Transparent;) but exported xaml contains wrong rectangle:
......
If I set StartColor and EndColor properties of subChart.Panel.Gradient to transparent, then the exported xaml will be ok. But it would be great if the source and exported TChart appear the same.
And finally, it seems that non-transparent value of subChart.Panel.Color property doesn't work in WPF TChart. If I set it to red, for example, then the subchart's background will be gradient of gray and white.
The problem is produced because you need set the panel gradient to false. The Subchart is exported with a transparent or coloured background without problems here, using the lines below.

Code: Select all

...         
subChart.Panel.Gradient.Visible = false; 
subChart.Panel.Color = Colors.Transparent; 
//subChart.Panel.Color = Colors.Red; 
...
Could you tell us if previous code works in your end?

Hoping it will helps.

Thanks in advance,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

neurosoft
Newbie
Newbie
Posts: 14
Joined: Wed May 14, 2014 12:00 am

Re: SubChart. Exporting to XAML

Post by neurosoft » Tue Aug 19, 2014 9:48 am

Could you tell us if previous code works in your end?
It works. But the problem is that if I don't hide gradient and set subChart.Panel.Color to transparent the picture on the screen and in the exported xaml are not the same.
It's not normal for me.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: SubChart. Exporting to XAML

Post by Sandra » Tue Aug 19, 2014 3:17 pm

Hello neurosoft,
It works. But the problem is that if I don't hide gradient and set subChart.Panel.Color to transparent the picture on the screen and in the exported xaml are not the same.It's not normal for me.
I would like inform you that the Chart or SubChart background shouldn't be transparent when the gradient is activated. Therefore, it is a canvas bug instead of xaml export bug. We’ve added the problem in the TeeChart.Net Bugzilla tracker to fix it to upcoming versions of TeeChartNET. Here http://bugs.teechart.net/show_bug.cgi?id=891 you have the link to the ticket. Feel Free to add your email account to the ticket so you can be automatically notified when and update arrives.

Thanks in advance,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply