Multiple Chart printing
Multiple Chart printing
I'm using TChart Pro ActiveX version 7. I've allocated several TChart objects on my dialog box dynamically. I now want to print all the charts to a single page. Can you point me to an example of how to do this? My code is somewhat like this
CTChart* pChart1 = new CTChart();
pChart.Create(.......);
CTChart* pChart2 = new CTChart();
pChart.Create(.......);
CTChart* pChart3 = new CTChart();
pChart.Create(.......);
CTeePrintPreviewPanel *pPanel = new CTeePrintPreviewPanel();
pPanel.AddChart(....);
pPanel.AddChart(pChart2);
pPanel.AddChart(pChart3);
The argument to AddChart has to be of type LPDISPATCH... not sure how to do this
CTChart* pChart1 = new CTChart();
pChart.Create(.......);
CTChart* pChart2 = new CTChart();
pChart.Create(.......);
CTChart* pChart3 = new CTChart();
pChart.Create(.......);
CTeePrintPreviewPanel *pPanel = new CTeePrintPreviewPanel();
pPanel.AddChart(....);
pPanel.AddChart(pChart2);
pPanel.AddChart(pChart3);
The argument to AddChart has to be of type LPDISPATCH... not sure how to do this
Hi,
you should assign the Charts like in the following code :
you should assign the Charts like in the following code :
Code: Select all
m_chart1.AddSeries(0);
m_chart1.Series(0).FillSampleValues(5);
m_chart2.AddSeries(0);
m_chart2.Series(0).FillSampleValues(5);
m_chart1.GetPrinter().SetPrintProportional(false);
m_chart1.GetPrinter().SetMarginLeft(2);
m_chart1.GetPrinter().SetMarginTop(2);
m_chart1.GetPrinter().SetMarginRight(60);
m_chart1.GetPrinter().SetMarginBottom(60);
m_chart2.GetPrinter().SetPrintProportional(false);
m_chart2.GetPrinter().SetMarginLeft(60);
m_chart2.GetPrinter().SetMarginTop(60);
m_chart2.GetPrinter().SetMarginRight(2);
m_chart2.GetPrinter().SetMarginBottom(2);
m_Preview.GetPanels().Clear();
m_Preview.AddChartLink(m_chart1.GetChartLink());
m_Preview.AddChartLink(m_chart2.GetChartLink());
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi,
I added the preview at design time, but creating it dinamically should work work in the same manner adding the Charts using the AddChartLink.
I added the preview at design time, but creating it dinamically should work work in the same manner adding the Charts using the AddChartLink.
Pep Jorge
http://support.steema.com
http://support.steema.com
Hi,
there's not a way to show the TeePreviewPanel as a dialog, this feature is already down our wish list to be considered for further releases.
In meantime a solution is to do it manually, placing a TeePreviewPanel component on a new form dialog (with other components like buttons to print, setup, etc..) and call this dialog from the parent form app.
there's not a way to show the TeePreviewPanel as a dialog, this feature is already down our wish list to be considered for further releases.
In meantime a solution is to do it manually, placing a TeePreviewPanel component on a new form dialog (with other components like buttons to print, setup, etc..) and call this dialog from the parent form app.
Pep Jorge
http://support.steema.com
http://support.steema.com
I placed the TeePreviewPanel manually on a dialog and this worked fine.
I placed 2 charts on the Panel as described above and they displayed correctly. However, when I move the crosshair (margins) on the preview panel, only the chart in the top left resizes in proportion to the margins - how can I set it up so all charts placed on the preview panel resize accordingly?
Also, can I have multiple charts - say "N" on the preview panel at one time?
I placed 2 charts on the Panel as described above and they displayed correctly. However, when I move the crosshair (margins) on the preview panel, only the chart in the top left resizes in proportion to the margins - how can I set it up so all charts placed on the preview panel resize accordingly?
Also, can I have multiple charts - say "N" on the preview panel at one time?
Hi,
All the Charts cannot be resized at the same time, but you can resize them individually by selecting to which one must be applied the margins using same code as in the TeeNew Demo : All Features -> Welcome ! -> Printing -> Multiple Charts (it shows how to do it clicking over each Chart).I placed 2 charts on the Panel as described above and they displayed correctly. However, when I move the crosshair (margins) on the preview panel, only the chart in the top left resizes in proportion to the margins - how can I set it up so all charts placed on the preview panel resize accordingly?
Yes, you can add multiple charts to the preview panel using the AddChart method, and resize them following the steps as in above answer.Also, can I have multiple charts - say "N" on the preview panel at one time?
Pep Jorge
http://support.steema.com
http://support.steema.com
Re: Multiple Chart printing
This is excellent discussion, just what I am needing.
I do not have wrapper class for previewpanel. When I create one using the ActiveX Control Wizard in VS2012. I do not get a GetPanels, but a get_Panels. I think I can create GetPanels from this, but then I am missing the Clear method on GetPanels. How do I get these??
I have looked through my installation of TeeChart (v5.0.6.0) and through the 2012 evaluation version and I see no header file that has the PreviewPanel class.
I do not have wrapper class for previewpanel. When I create one using the ActiveX Control Wizard in VS2012. I do not get a GetPanels, but a get_Panels. I think I can create GetPanels from this, but then I am missing the Clear method on GetPanels. How do I get these??
I have looked through my installation of TeeChart (v5.0.6.0) and through the 2012 evaluation version and I see no header file that has the PreviewPanel class.
Re: Multiple Chart printing
I do not know how I missed finding the teepreviewpanel.* and the teepanelslist.* earlier, but I have found them now.
Thanks
Thanks