Skip to main content
A newer version of this page is available.

ChartPrinter.CreateArea(String, IBrickGraphics) Method

Creates the document elements (bricks) for a specific area.

Namespace: DevExpress.XtraCharts.Printing

Assembly: DevExpress.XtraCharts.v18.2.dll

Declaration

public virtual void CreateArea(
    string areaName,
    IBrickGraphics graph
)

Parameters

Name Type Description
areaName String

The name of the document area (section) for which elements should be created.

graph IBrickGraphics

An object implementing the IBrickGraphics interface, which is a graphical surface on which document elements will be drawn.

Remarks

Note that the CreateArea method should be called after the ChartPrinter.Initialize and before the ChartPrinter.Release method calls.

Example

This example demonstrates how to specify the printing settings of a chart (to fit its size to the page width), using the ChartPrinter class.

using System;
using System.Windows.Forms;
using DevExpress.XtraPrinting;
using DevExpress.XtraCharts.Printing;
// ...

ChartPrinter cp;

private void button1_Click(object sender, EventArgs e) {
    Link l = new Link(new PrintingSystem());
    l.Landscape = true;
    l.PaperKind = System.Drawing.Printing.PaperKind.A3;
    cp = new ChartPrinter(this.chartControl1);
    cp.Initialize(l.PrintingSystem, l);
    cp.SizeMode = PrintSizeMode.Stretch;
    l.CreateDetailArea += new CreateAreaEventHandler(l_CreateDetailArea);
    l.ShowPreviewDialog();
    cp.Release();
}

void l_CreateDetailArea(object sender, CreateAreaEventArgs e) {
    cp.CreateDetail(e.Graph);
}
See Also