PieSeries

Represents a PieSeries.

public class PieSeries : SeriesBase
Public Class PieSeries
    Inherits SeriesBase

Inheritance: ObjectPlotAreaElementSeriesBasePieSeries

Licensing Info

This class is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:

Examples

The following example creates a pie chart.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Charting
Imports ceTe.DynamicPDF.PageElements.Charting.Series    
    
Module MyModule
    
    Sub Main()
    
        ' Create a PDF Document
        Dim MyDocument As Document = New Document()
    
        ' Create a Page and add it to the document
        Dim MyPage As Page = New Page(PageSize.A4, PageOrientation.Landscape)
        MyDocument.Pages.Add(MyPage)
    
        ' Create a chart
        Dim MyChart As Chart = New Chart(0, 0, 400, 200)
    
        ' Get the default plot area from the chart
        Dim MyPlotArea As PlotArea = MyChart.PrimaryPlotArea
    
        ' Create header titles and add it to the chart
        Dim MyTitle1 As Title = New Title("Website Visitors")
        Dim MyTitle2 As Title = New Title("Year - 2007")
        MyChart.HeaderTitles.Add(MyTitle1)
        MyChart.HeaderTitles.Add(MyTitle2)
    
        ' Create a data label
        Dim da As ScalarDataLabel = New ScalarDataLabel(True, False, False)
    
        ' Create a pie series and set data label to the pie series
        Dim MyPieSeries As PieSeries = New PieSeries()
        MyPieSeries.DataLabel = da
    
        ' Add the elements to the plot area
        MyPlotArea.Series.Add(MyPieSeries)
        MyPieSeries.Elements.Add(27, "Website A")
        MyPieSeries.Elements.Add(19, "Website B")
        MyPieSeries.Elements.Add(21, "Website C")
    
        ' Add the chart to page and add the page to document
        MyPage.Elements.Add(MyChart)
    
        ' Draw the document
        MyDocument.Draw("C:\MyDocument.pdf")
    
    End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Charting;
using ceTe.DynamicPDF.PageElements.Charting.Series;

public class Example
{
    public static void CreatePDF(string outputPath)
    {
        // Create a PDF Document
        Document document = new Document();

        // Create a Page and add it to the document
        Page page = new Page(PageSize.A4, PageOrientation.Landscape);
        document.Pages.Add(page);

        // Create a chart
        Chart chart = new Chart(0, 0, 400, 200);

        // Get the default plot area from the chart
        PlotArea plotArea = chart.PrimaryPlotArea; 

        // Create header titles and add it to the chart
        Title title1 = new Title("Website Visitors");
        Title title2 = new Title("Year - 2007");
        chart.HeaderTitles.Add(title1);
        chart.HeaderTitles.Add(title2);

        // Create a data label
        ScalarDataLabel da = new ScalarDataLabel(true, false, false);

        // Create a pie series and set data label to the pie series
        PieSeries pieSeries = new PieSeries();
        pieSeries.DataLabel = da;

        // Add the elements to the plot area
        plotArea.Series.Add(pieSeries);
        pieSeries.Elements.Add(27, "Website A");
        pieSeries.Elements.Add(19, "Website B");
        pieSeries.Elements.Add(21, "Website C");
  
        // Add the chart to page and add the page to document
        page.Elements.Add(chart);

        // Draw the document
        document.Draw(outputPath);
    }
}

Constructors

PieSeries()Initializes a new instance of the PieSeries class.
PieSeries(Legend)Initializes a new instance of the PieSeries class.
PieSeries(SeriesLabel)Initializes a new instance of the PieSeries class.
PieSeries(SeriesLabel, Single, Color, Legend)Initializes a new instance of the PieSeries class.
PieSeries(Single, Color)Initializes a new instance of the PieSeries class.
PieSeries(Single, Color, Legend)Initializes a new instance of the PieSeries class.

Properties

BorderColorGets or sets the Color object to use for the borders of the PieSeries.
BorderWidthGets or sets the BorderWidth of the PieSeries.
DataLabelGets or sets the ScalarDataLabel object to use for the data label of the Pie series. This is the default data label for the series.
DataLabelPositionGets or sets ScalarDataLabelPosition enumeration that specifies the display position of the data label.
DrawBehindAxisGets or sets the position of the Series either below or above the axis. By default it is true.
(Inherited from SeriesBase)
ElementsGets the PieSeriesElementList object contained in the PieSeries.
HeightGets the height of the PieSeries.
LabelGets or sets the SeriesLabel object to use for the name of the PieSeries.
LegendGets or sets the Legend object of the PlotAreaElement.
(Inherited from PlotAreaElement)
PercentageFormatGets or sets the format to use for the percentage of the ScalarDataLabel object.
PlotAreaGets the PlotArea object of the PlotAreaElement.
(Inherited from PlotAreaElement)
RadiusGets or sets the radius of the PieSeries.
StartAngleGets or sets the StartAngle of the PieSeries.
ValueFormatGets or sets the format to use for the value of the ScalarDataLabel object.
WidthGets the width of the PieSeries.
XGets the X coordinate of the PieSeries.
XOffsetGets or sets the XOffset of the PieSeries.
YGets the Y coordinate of the PieSeries.
YOffsetGets or sets the YOffset of the PieSeries.

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
SetArea(Single, Single, Single, Single)Set the area of the PieSeries.
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.PageElements.Charting.Series

In this topic