Exporting WPF TChart to XAML. Clipped rectangle borders.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
neurosoft
Newbie
Newbie
Posts: 12
Joined: Mon Jun 04, 2012 12:00 am

Exporting WPF TChart to XAML. Clipped rectangle borders.

Post by neurosoft » Wed Feb 06, 2013 5:46 am

Hello steema!
I've downloaded the latest version of WPF TeeChart. And I've got some new bugs in exporting TeeChart to XAML.
If I try to export Bar with borders or Point with borders and pointer style as Rectangle, I have incorrect result. Clip rectangles are too small for that series.
For example, try to execute the following code:

Code: Select all

       
            MyTChart.Aspect.View3D = false;
            Points points = new Points();
            points.Pointer.Style = PointerStyles.Rectangle;
            points.Pointer.Pen.Color = Colors.Black;            
            points.Add(10);
            MyTChart.Series.Add(points);

            Bar bar = new Bar();
            bar.Add(5);
            bar.Pen.Color = Colors.Black;
            bar.Brush.Color = Colors.White;                    
            MyTChart.Series.Add(bar);
and then

Code: Select all

MyTChart.Export.Image.XAML.Save(exportedXamlPath);
You will see, that some borders in source TeeChart are clipped in exported XAML.
Source:
Borders.jpg
Borders.jpg (27.46 KiB) Viewed 11807 times
Result:
BordersExport.jpg
BordersExport.jpg (26 KiB) Viewed 11819 times
If you open exported XAML with text editor, you can see incorrect part:
<Rectangle Fill="#FFFFFFFF" StrokeThickness="1" Stroke="#FF000000"
Canvas.Left="115.176666666667" Canvas.Top="63" Width="10" Height="10">
<Rectangle.Clip>
<RectangleGeometry Rect="0,0,9,9"/>
</Rectangle.Clip>
</Rectangle>
<Rectangle Fill="#FFFFFFFF" StrokeThickness="1" Stroke="#FF000000"
Canvas.Left="89.1766666666667" Canvas.Top="119" Width="62" Height="53">
<Rectangle.Clip>
<RectangleGeometry Rect="0,0,61,52"/>
</Rectangle.Clip>
</Rectangle>

neurosoft
Newbie
Newbie
Posts: 12
Joined: Mon Jun 04, 2012 12:00 am

Re: Exporting WPF TChart to XAML. Clipped rectangle borders.

Post by neurosoft » Wed Feb 06, 2013 6:12 am

I have the same problem with FastLine series.
Every line in exported TeeChart is clipped by rectangle. I don't know why do you do it, but it's not good.
You can see it by exporting the TeeChart with the next fast line, for example:

Code: Select all

                FastLine fastLine = new FastLine();
                fastLine.ShowInLegend = false;
               
                for (int i = 0; i < 50; i++)
                {
                    double x = i / 5d;
                    fastLine.Add(x, Math.Sin(x) * 3);
                }
                MyTChart.Series.Add(fastLine);
The source TeeChart is:
FastLineSource.jpg
FastLineSource.jpg (33.02 KiB) Viewed 11777 times
The exported XAML looks like this:
FastLineExport.jpg
FastLineExport.jpg (31.84 KiB) Viewed 11781 times

neurosoft
Newbie
Newbie
Posts: 12
Joined: Mon Jun 04, 2012 12:00 am

Re: Exporting WPF TChart to XAML. Clipped rectangle borders.

Post by neurosoft » Wed Feb 06, 2013 6:19 am

Maybe I'm mistaken, but I think you have to clip once all TeeChart region, not every object, placed on the TeeChart.

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

Re: Exporting WPF TChart to XAML. Clipped rectangle borders.

Post by Sandra » Wed Feb 06, 2013 4:56 pm

Hello neurosoft,

Thanks for information. I have added the problem in the bug list report with number[TF02016503]. We will try to fix it for next maintenance releases.

Thanks,
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

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

Re: Exporting WPF TChart to XAML. Clipped rectangle borders.

Post by Sandra » Fri Feb 15, 2013 5:16 pm

Hello neurosoft,

I inform you that we have already fixed the bug number[TF02016503] to next version of TeeChartFor.Net. On the other hand, we have made for you a simple workaround that solve the problem that occurs because of a discrepancy between Rectangle.Clip and Width and Height. It consist in modify the xaml file manually to correct the error.

Code: Select all

  <Rectangle Fill="#FFFFFFFF" StrokeThickness="1" Stroke="Black"

Canvas.Left="261" Canvas.Top="72" Width="10" Height="10">

    <Rectangle.Clip>

      <RectangleGeometry Rect="0,0,9,9"/>

    </Rectangle.Clip>

  </Rectangle>

As you see in previous code, changing the Width and Height from “10” to “9” fixes the 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
Image Image Image Image Image Image
Instructions - How to post in this forum

neurosoft
Newbie
Newbie
Posts: 10
Joined: Fri May 17, 2013 12:00 am

Re: Exporting WPF TChart to XAML. Clipped rectangle borders.

Post by neurosoft » Wed Jun 19, 2013 9:18 am

Hello steema,
I'm very disapointed because my problem is not fixed in the latest release. I've downloaded WPF TeeChart ver. 4.1.2013.05282. The problem TF02016503 is marked as fixed in "Release Notes", but everything which I wrote above is true.
I have no words to describe what I think about it.

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

Re: Exporting WPF TChart to XAML. Clipped rectangle borders.

Post by Sandra » Wed Jun 19, 2013 12:38 pm

Hello neurosft,
I'm very disapointed because my problem is not fixed in the latest release. I've downloaded WPF TeeChart ver. 4.1.2013.05282. The problem TF02016503 is marked as fixed in "Release Notes", but everything which I wrote above is true.
I have no words to describe what I think about it.
Ok. After doing some tests using Winforms and Wpf we get next results:

Winforms vs WPF Bar export:
If we export the Bar as a xaml when you we use winforms the problem is solved.
If we export the Bar as a xaml when we use wpf MainForm the problem persist.
Conclusion, in the case of Bar, seems the problem isn't solved by wpf but is solved in Winforms, for this reason we close the bug. Therefore, we have added again it in bug list report with number [TF02016608].

Winforms vs WPF FastLine export:
The problems isn't solved for the both cases. We have added a new bug report with number [TW16016609]. We will try to fix it to upcoming versions of TeeChartFor.Net.

We apologize with you for consider a bug fixed when it isn't completely, I have made a mistake to think the bug is fixed, checking only the behavior of exporting for Bar series in Winforms.

Thanks and sorry,
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