Hi Yeray!
I have created TChart, represented by the picture
- TeeChartSource.jpg (19.02 KiB) Viewed 11173 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 (
) 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?