C# code tutorial

PDF Chart PDF Creating & Inserting PDF to Image PDF Digital Signature PDF Extracting PDF Processing & Editing PDF Protecting PDF Barcode

Popular .NET SDK

A combination chart is a chart that combines different chart types and adding a secondary axis. Combination charts allow you to plot multiple datasets on the same chart.

PDF combination chart is a chart that combines two or more chart types in a single chart.

.NET PDF Chart Maker allows developers to mix different types on a single chart by assigning different chart types to different series on the chart. Users can create combination chart with a wider variety of combinations into PDF pages from multiple Visual .NET applications, such as C#, VB.NET, ASP.NET and WinForms.

To combine several chart types in one chart you only need to create series of different types. This online guide shows you a single visualization that combines a line chart and a column chart created and added in PDF page using C# language.

static void AddExplodedPieChartToPDF()
    // Create a new PDF document.
    PdfDocument document = new PdfDocument();

    // Create a page.
    PdfPage page = document.AddPage();

    // Generate a 2d exploded pie chart graph
    Chart chart = PieExplodedChart();

    // Create a chart frame, set chart location and size
    ChartFrame chartFrame = new ChartFrame();
    chartFrame.Location = new XPoint(30, 30);
    chartFrame.Size = new XSize(500, 600);

    // Render chart symbols into pdf page
    XGraphics g = XGraphics.FromPdfPage(page);

    // Save and show the document           

static Chart PieExplodedChart()
    // Set chart type to Area2D
    Chart chart = new Chart(ChartType.PieExploded2D);

    // Add series of exploded pie chart with name and data
    Series series = chart.SeriesCollection.AddSeries();
    series.Add(new double[] { 1, 17, 45, 5, 3, 20, 11, 23, 8, 19, 34, 56, 23, 45 });

    // Set legend
    chart.Legend.Docking = DockingType.Left;

    chart.DataLabel.Type = DataLabelType.Percent;
    chart.DataLabel.Position = DataLabelPosition.Center;

    return chart;

More Excel tutorial