Export TChart to XAML throws exception
Posted: Thu Sep 16, 2010 12:16 pm
Hi steema people!
I have problem with exporting TChart to XAML again.
The following code
throws exception:
I have problem with exporting TChart to XAML again.
The following code
Code: Select all
TChart MyTChart = new TChart();
MyTChart.Series.Add(new Bar());
Bar series = MyTChart[0] as Bar;
MyTChart.Aspect.View3D = false;
for (int i = 0; i < 10; i++)
{
series.Add(i);
}
series.ShowInLegend = true;
MyTChart.Legend.CheckBoxes = true;
using (MemoryStream ms = new MemoryStream())
{
MyTChart.Export.Image.XAML.Width = 200;
MyTChart.Export.Image.XAML.Height = 100;
MyTChart.Export.Image.XAML.Save(ms);
}
Please, check it.Unable to cast object of type 'Steema.TeeChart.WPF.Drawing.Graphics3DXAML' to type 'Steema.TeeChart.WPF.Drawing.Graphics3DWPF'
at Steema.TeeChart.WPF.Legend.DrawLegendItem(Int32 ItemIndex, Int32 ItemOrder)
at Steema.TeeChart.WPF.Legend.DrawItems()
at Steema.TeeChart.WPF.Legend.Paint(Graphics3D g, Rect rect)
at Steema.TeeChart.WPF.Chart.DoDrawLegend(Rect& tmp)
at Steema.TeeChart.WPF.Chart.DrawTitlesAndLegend(DrawingContext g, Rect& tmp, Boolean BeforeSeries)
at Steema.TeeChart.WPF.Chart.InternalDraw(DrawingContext g, Boolean noTools)
at Steema.TeeChart.WPF.Chart.Draw(DrawingContext g, Rect r, Boolean noTools)
at Steema.TeeChart.WPF.Chart.Draw(DrawingContext g, Rect r)
at Steema.TeeChart.WPF.Export.XAMLFormat.Save(Stream stream)