PdfContents.DrawChart Method (PdfChart, Double, Double, Double, Double, Boolean, Boolean)

PDF File Writer

PdfContentsDrawChart Method (PdfChart, Double, Double, Double, Double, Boolean, Boolean)

Draw chart

Namespace:  PdfFileWriter
Assembly:  PdfFileWriter (in PdfFileWriter.dll) Version: 1.1.24.0 (1.1.24.0)
Syntax
C#
public void DrawChart(
	PdfChart PdfChart,
	double OriginX,
	double OriginY,
	double Width,
	double Height,
	bool DisposeChart = true,
	bool GCCollect = true
)

Parameters

PdfChart
Type: PdfFileWriterPdfChart
PdfChart resource
OriginX
Type: SystemDouble
Origin X
OriginY
Type: SystemDouble
Origin Y
Width
Type: SystemDouble
Display width
Height
Type: SystemDouble
Display height
DisposeChart (Optional)
Type: SystemBoolean
Dispose chart
GCCollect (Optional)
Type: SystemBoolean
Run the garbage collector
Remarks

The chart is saved in the PDF document as an image.

The PdfChart resource contains a .NET Chart class. The .NET Chart defines width and height in pixels and image resolution in pixels per inch.

The chart will be stretched or shrunk to fit the display width and display height. Use PdfChart.ImageSize(...) or PdfChart.ImageSizePosition(...) to ensure correct aspect ratio and positioning.

The .NET Chart member is defined by the user. It must be disposed in order to free unmanaged resources. If DisposeChart is true the DrawChart will call the Chart.Dispose() method. If the DisposeChart is false it is the responsibility of the calling method to dispose of the chart.

See Also