Area chart creator coming with built-in area chart symbols and ready-made area chart templates, to make it easy for developers to create polygons based on the data.
PDF area chart is a a two-axis chart, which is similar to line chart with the area between the line and axis filled in. Area chart view is useful when you need to show trends for several series on the same diagram, and also show the relationship of the parts to the whole.
.NET PDF Area Chart maker can create area chart graphs with single or multiple data sets, as well as arrays with null values and array of arrays. Developers can create area charts and insert the diagrams to PDF pages using XsPDF chart designer in .NET C# language.
static void AddAreaChartToPDF() { // Create a new PDF document. PdfDocument document = new PdfDocument(); // Create a page. PdfPage page = document.AddPage(); // Generate a 2d area chart graph Chart chart = AreaChart(); // 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); chartFrame.Add(chart); // Render chart symbols into pdf page XGraphics g = XGraphics.FromPdfPage(page); chartFrame.Draw(g); // Save and show the document document.Save("AreaChart.pdf"); Process.Start("AreaChart.pdf"); } static Chart AreaChart() { // Set chart type to Area2D Chart chart = new Chart(ChartType.Area2D); // Add first series of area chart with name and data Series series = chart.SeriesCollection.AddSeries(); series.Add(new double[] { 31, 9, 15, 28, 13 }); // Add second series of area chart with name and data series = chart.SeriesCollection.AddSeries(); series.Add(new double[] { 22, 7, 12, 21, 12 }); // Add third series of area chart with name and data series = chart.SeriesCollection.AddSeries(); series.Add(new double[] { 16, 5, 3, 20, 11 }); // Set X axes chart.XAxis.TickLabels.Format = "00"; chart.XAxis.MajorTickMark = TickMarkType.Outside; chart.XAxis.Title.Caption = "X-Axis"; // Set Y axes chart.YAxis.MajorTickMark = TickMarkType.Outside; chart.YAxis.HasMajorGridlines = true; // Set plot area (chart diagram) chart.PlotArea.LineFormat.Color = XColors.DarkGray; chart.PlotArea.LineFormat.Width = 1; chart.PlotArea.LineFormat.Visible = true; // Set legend chart.Legend.Docking = DockingType.Top; return chart; }
More Excel tutorial
- Reading Form Fields in PDF file using Visual Studio .NET framework and XsPDF source code
- Generate graphs to PDF in Visual Studio .NET framework
- PDF document decrypted - Visual Studio .NET framework online guide
- Processing Acrobat PDF using Visual Studio .NET framework and XsPDF Control
- Sample code for conversion PDF page to png file