I create more child chart in tChart1, but how to print child chart, please look at the code:
// init child chart
for (int i = 0; i < 4; i++) {
Steema.TeeChart.WPF.TChart child = new Steema.TeeChart.WPF.TChart();
...
...
tChart1.Children.Add(child);
}
// Referring to the teechart wpf example
documentViewer1.Document = CreateFixedDocumentWithPage();
// Referring to the teechart wpf example
FixedDocument CreateFixedDocument() { ... }
...
private PageContent CreateFirstPageContent() {
PageContent pageContent = new PageContent();
FixedPage fixedPage = new FixedPage();
Canvas canvas1 = new Canvas();
...
Steema.TeeChart.WPF.TChart child = (Steema.TeeChart.WPF.TChart)tChart1.Children[0];
DrawingVisual d = new DrawingVisual();
DrawingContext g = d.RenderOpen();
child.Draw(g);
AdornerLayer parent = AdornerLayer.GetAdornerLayer(child);
if (parent != null)
{
Adorner[] adorners = parent.GetAdorners(child);
if (adorners != null)
{
foreach (TeeAdorner item in adorners)
{
item.Draw(g);
}
}
}
g.Close();
...
fixedPage.Children.Add(canvas1);
....
}
-----------------------------------------------------------------------------------------------------------------------------
why child chart can not print in DocumentViewer? Please taught me how to do, thanks.
I'm working environment is: VS2010(.NET Framework 4.0) / Windows7
How to print child chart for TeeChart.WPF
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: How to print child chart for TeeChart.WPF
Hi Candy,
You should do something very similar to the demo. Find attached a simple example project showing it. This is a Visual Studio 2013 .NET Framework 4.5.1 project. You just need to change the project TeeChart.WPF.dll reference to the version you use. If you have any problem with the project just use MainWindow.xaml and MainWindow.xaml.cs.
You should do something very similar to the demo. Find attached a simple example project showing it. This is a Visual Studio 2013 .NET Framework 4.5.1 project. You just need to change the project TeeChart.WPF.dll reference to the version you use. If you have any problem with the project just use MainWindow.xaml and MainWindow.xaml.cs.
- Attachments
-
- WpfApplication1.zip
- (9.15 KiB) Downloaded 587 times
Best Regards,
Narcís Calvet / 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 |
Re: How to print child chart for TeeChart.WPF
I was successful, thank you very much