Page 1 of 1

Export TeeChart to xaml Bug.

Posted: Tue Jul 20, 2010 9:53 am
by 15656109
Hello.
I have problems with exporting of WPF TChart to Xaml.
So, I have created TeeChart instance by the following code:

Code: Select all

TChart tChart = new TChart();
tChart.Series.Add(new Bar());
Bar series = tChart[0] as Bar;
series.Brush.ForegroundColor = Colors.Black;
GeometryDrawing drawing = new GeometryDrawing(Brushes.Black, new Pen(Brushes.Black, 1), new LineGeometry(new Point (0, 10), new Point(10, 0)));
series.Brush.Drawing = drawing;
tChart.Aspect.View3D = false;
for (int i = 0; i < 10; i++)
{
    series.Add(i);
}            
series.ShowInLegend = false;
The result is represented by the picture:
TeeChartSource.jpg
TeeChartSource.jpg (19.02 KiB) Viewed 11347 times
And when I try to export this TeeChart to xaml, I recieve incorrect result (exported xaml in attachment
ExportedTeeChart.xaml.ZIP
(2.26 KiB) Downloaded 419 times
):
ExportedTeeChart.jpg
ExportedTeeChart.jpg (18.31 KiB) Viewed 11348 times
As you see, dashed lines are very thick and exported chart has no DrawingGeometry texture in Bar.

Thanks.

Re: Export TeeChart to xaml Bug.

Posted: Thu Jul 22, 2010 1:21 pm
by 10050769
retard Hello neurosoft,


Sorry for the delay, I can reproduce your problem and I communicate you that I have added bug in wish-list with number [TF02015043]. We will try to fix it for next maintenances releases of TeeChart.Net.


Thanks,

Re: Export TeeChart to xaml Bug.

Posted: Thu Jul 22, 2010 1:40 pm
by 15656109
Sandra, thanks for reply. I'll wait for next release with the hope, that the bug is fixed.

Re: Export TeeChart to xaml Bug.

Posted: Mon Aug 02, 2010 8:43 am
by 10050769
Hello neurosoft,

I inform that bug with number (TF02015043) is not a bug, because HatchBrush does not exist in WPF/XAML. Moreover, I have added it in wish-list as a future request with number[TW16015062]to be implemented in future releases of TeeChartWPF.


Thanks.

Re: Export TeeChart to xaml Bug.

Posted: Wed Aug 11, 2010 6:35 am
by 15656109
Hello Sandra!
1) Besides export of DrawingGeometry, I wrote about very thick dashed grid lines in exported xaml picture (vertical and horizontal lines). Please, pay attention to this remark.
2) I did't create HatchBrush for the Bar, because HatchBrush is not System.Windows.Media.Brush. In Windows Forms TChart I used property Style of the Steema.TeeChart.Drawing.Brush to set HatchStyle of the Bar. But in WPF version type Steema.TeeChart.WPF.Drawing.Brush has no Style property. For creating texture of the Bar I use property Drawing. And it works. But, as you see, I have problems with export TChart to xaml. So, if you consider, that is not a bug (that is wrong for my opinion), tell me how I can create Hatch in the Bar with the correct exporting.

Re: Export TeeChart to xaml Bug.

Posted: Thu Aug 12, 2010 9:11 am
by 10050769
Hello neurosoft,

2) I did't create HatchBrush for the Bar, because HatchBrush is not System.Windows.Media.Brush. In Windows Forms TChart I used property Style of the Steema.TeeChart.Drawing.Brush to set HatchStyle of the Bar. But in WPF version type Steema.TeeChart.WPF.Drawing.Brush has no Style property. For creating texture of the Bar I use property Drawing. And it works. But, as you see, I have problems with export TChart to xaml.
OK. Could you please, send us a simple project in WPF, because we can reproduce your exactly problem here?
So, if you consider, that is not a bug (that is wrong for my opinion), tell me how I can create Hatch in the Bar with the correct exporting
We don't consider it as a bug because TeeChart.WPF doesn't have HatchStyle property, so it's more a lack than a problem. We call this type of problems as "Feature Request" but, actually, wish or bug/defect lists are internally the same list. What changes is the category of the issue but most important for us is the priority we give to each issue and this is quite an important one.


Thanks,

Re: Export TeeChart to xaml Bug.

Posted: Thu Aug 12, 2010 12:24 pm
by 15656109
Hello!
OK. Could you please, send us a simple project in WPF, because we can reproduce your exactly problem here?
Ok. I have created a simple WPF Application (
TChartExportTest.ZIP
(42.29 KiB) Downloaded 397 times
).
Please, add TeeChart.WPF.dll to the project references and run application. Then click "Export..." and choose the file for saving TeeChart. You will see that the exported TeeChart does not correspond to the original:
1) Dashed grid lines is very thick;
2) Background of the Bars became solid color, but in source TeeChart it was diagonal lines texture.
Is it normal behavior for the export? By the way, export to bitmap image works normally.
And I have not received the answer for the question about very thick dashed grid lines.

Re: Export TeeChart to xaml Bug.

Posted: Fri Aug 13, 2010 11:38 am
by 10050769
Hello neurosoft,

We haven forgotten you, we'll inform you asap.

Thanks,

Re: Export TeeChart to xaml Bug.

Posted: Mon Aug 23, 2010 3:20 pm
by yeray
Hello neurosoft,

Excuse us for the delay. I could reproduce also in WinForms so we will study the problem and try to found what's wrong or missing here.

Re: Export TeeChart to xaml Bug.

Posted: Tue Aug 24, 2010 5:24 am
by 15656109
Thanks, Yeray!
We'll hope, that you will solve this issue.

Re: Export TeeChart to xaml Bug.

Posted: Mon Aug 30, 2010 9:26 am
by yeray
Hi neurosoft,

As we thought initially, implementing the HatchBrush property in WPF, would allow this in WPF and in extension in XAML exports (or vice versa).

Re: Export TeeChart to xaml Bug.

Posted: Tue Aug 31, 2010 11:31 am
by 15656109
Hi Yeray!
I have created TChart, represented by the picture
TeeChartSource.jpg
TeeChartSource.jpg (19.02 KiB) Viewed 11082 times
with help of following code:

Code: Select all

TChart tChart = new TChart();
tChart.Series.Add(new Bar());
Bar series = tChart[0] as Bar;
series.Brush.ForegroundColor = Colors.Black;
GeometryDrawing drawing = new GeometryDrawing(Brushes.Black, new Pen(Brushes.Black, 1), new LineGeometry(new Point (0, 10), new Point(10, 0)));
series.Brush.Drawing = drawing;
tChart.Aspect.View3D = false;
for (int i = 0; i < 10; i++)
{
    series.Add(i);
}           
series.ShowInLegend = false;
Exporting to xaml of the Drawing property has no require the HatchBrush property. It is easy to present the GeometryDrawing from the code, described above, in xaml:

Code: Select all

    <GeometryDrawing Geometry="M 0,10 L 10,0 Z">
        <GeometryDrawing.Pen>
            <Pen Brush="Black" Thickness="1"/>
        </GeometryDrawing.Pen>
    </GeometryDrawing>
In other words, Steema.TeeChart.WPF.Drawing.ChartBrush has the Drawing property. Why this property is ignored by the exporting to xaml?
Now the Bar in the xaml (
ExportedTeeChart.xaml.ZIP
(2.26 KiB) Downloaded 431 times
) of the exported TChart is represented by the following code:

Code: Select all

<Rectangle Fill="#FF4466A3" Stroke="#FF293D62"
 Canvas.Left="..." Canvas.Top="..." Width="..." Height="..."/>
I think that it have to be represented by the another xaml:

Code: Select all

<Rectangle Fill="#FF4466A3" Stroke="#FF293D62"
 Canvas.Left="..." Canvas.Top="..." Width="..." Height="...">
    <Rectangle.Fill>
        <DrawingBrush TileMode="Tile" Viewport="0,0,10,10" ViewportUnits="Absolute">
           <DrawingBrush.Drawing>
               <GeometryDrawing Geometry="M 0,10 L 10,0 Z">
                   <GeometryDrawing.Pen>
                       <Pen Brush="Black" Thickness="1"/>
                  </GeometryDrawing.Pen>
               </GeometryDrawing>
           </DrawingBrush.Drawing>
        </DrawingBrush>
    </Rectangle.Fill>
</Rectangle>
So, the main question is how can I receive the correct xaml of a TChart with Drawing in the series Brush?

Re: Export TeeChart to xaml Bug.

Posted: Thu Sep 02, 2010 9:57 am
by yeray
Hi neurosoft,

We've implemented the HatchBrush property in WPF so the following will be possible with the next maintenance release:

Code: Select all

            tChart1.Aspect.View3D = false;

            Steema.TeeChart.WPF.Styles.Bar series = new Steema.TeeChart.WPF.Styles.Bar(tChart1.Chart);
            series.FillSampleValues(6);

            series.Brush.ForegroundColor = Colors.Black;
            series.Brush.Style = Steema.TeeChart.WPF.Drawing.HatchStyle.DarkUpwardDiagonal;
HatchStyle.png
HatchStyle.png (17.78 KiB) Viewed 11069 times
However, this still will not export to XAML. We are looking into getting this to export successfully to XAML.