Page 1 of 1
Request for pdf export
Posted: Fri Oct 12, 2012 8:42 pm
by 15663432
Can you add the following support to the pdf export option for all teecharts:
GDI+ Drawing methods
GDI+ drawn directly on the teechart canvas
lines, ellipses, rectangles etc
textout method for drawing text
Basically, the same output obtained from printing a teechart in a pdf export file.
Re: Request for pdf export
Posted: Mon Oct 15, 2012 8:22 am
by 10050769
Hello lilo,
You need know that the TeeChartFor.Net is to default GDI+ and it allow you work with Drawing methods to draw directly in canvas using the events of TeeChart.Net, e.g, AfterDraw event it works correctly in most cases. You can see next example as you do to draw rectangles, lines, ellipses an textout in TeeChartFor.Net and export it correctly.
Code: Select all
public Form1()
{
InitializeComponent();
InitializeChart();
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart1.AfterDraw += new PaintChartEventHandler(tChart1_AfterDraw);
tChart1.Draw();
}
void tChart1_AfterDraw(object sender, Graphics3D g)
{
//Rectangle HatchStyle
g.Brush.Color = Color.Red;
g.Brush.Solid = true;
g.Rectangle(50, 150, 100, 100);
Rectangle rect = new Rectangle(150, 130, 120, 15);
//Font Text
g.Font.Color = Color.Purple;
g.TextOut(300, 170, "TeeChart2012");
//Line
g.Pen.Color = Color.Red;
g.Pen.Width = 3;
g.Line(new Point(120, 170), new Point(170, 220));
//Ellipse
Rectangle rect1 = new Rectangle(300, 250, 200, 150);
g.Brush.Color = Color.Yellow;
g.Brush.Solid = true;
g.Ellipse(rect1);
tChart1.Export.Image.PDF.Save(@"C:\tmp\tchart1.pdf");
}
Moreover, you have more examples in the Tutorial13 - Custom Drawing on the Chart Panel. On the other hand, I inform you there is a bug number [TF02016273] in wish list to fix the problems have export pdf when try to export font, HatchBrush of rectangle and region that you draw directly in the canvas.
I hope will helps
Thanks,