Hi All,
I would like to draw the second chart at the top right corner of the first chart's canvas, and then print out this combined chart layout. Can we do it ? Thank you very much for your support.
Bye,
Brian
Can we have two charts in the same canvas?
Hi brian
Yes, you can do it. You have to print the form, you can do something similiar as below code:
We are currently working in v3 and it will include SubChart tool which will make what you request much easier as you will just need to print the parent chart.
Yes, you can do it. You have to print the form, you can do something similiar as below code:
Code: Select all
private void button1_Click(object sender, EventArgs e)
{
System.Drawing.Printing.PrintDocument document = new System.Drawing.Printing.PrintDocument();
document.PrintController = new System.Drawing.Printing.StandardPrintController();
document.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(document_PrintPage);
document.Print();
}
void document_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
Rectangle r1 = new Rectangle(0, 0 , tChart1.Chart.Width , tChart1.Chart.Height );
Rectangle r2 = new Rectangle(tChart2.Left - tChart1.Left, 0, tChart2.Chart.Width , tChart2.Chart.Height);
System.Drawing.Imaging.Metafile m = tChart1.Chart.Metafile(tChart1.Chart, r1.Width , r1.Height);
System.Drawing.Imaging.Metafile m2 = tChart1.Chart.Metafile(tChart2.Chart, r2.Width, r2.Height);
e.Graphics.DrawImage(m, r1, tChart1.Chart.ChartBounds, GraphicsUnit.Pixel);
e.Graphics.DrawImage(m2, r2, tChart2.Chart.ChartBounds, GraphicsUnit.Pixel);
}
Thank you very much
Hi Edu,
Thank you very much for your suggestion.
Bye,
Brian
Thank you very much for your suggestion.
Bye,
Brian