Skip to main content

PieSeries

Version: 10.0

cete.dynamicpdf.pageelements.charting.series.pieseries

PieSeries​

Represents a PieSeries.

public class PieSeries : SeriesBase
Public Class PieSeries
Inherits SeriesBase

Inheritance: Object → PlotAreaElement → SeriesBase → PieSeries

Licensing​

This class is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:

  • DynamicPDF Generator for .NET Enterprise Edition
  • DynamicPDF Merger for .NET Enterprise Edition
  • DynamicPDF ReportWriter for .NET Enterprise Edition
  • DynamicPDF Core Suite for .NET Enterprise Edition

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.

public PieSeries()
Public Sub New ()

PieSeries(Legend)​

Initializes a new instance of the PieSeries class.

public PieSeries(Legend legend)
Public Sub New (legend As Legend)

Parameters​

Legend of the pie series.

PieSeries(SeriesLabel)​

Initializes a new instance of the PieSeries class.

public PieSeries(SeriesLabel seriesLabel)
Public Sub New (seriesLabel As SeriesLabel)

Parameters​

SeriesLabel of the pie series.

PieSeries(SeriesLabel, Single, Color, Legend)​

Initializes a new instance of the PieSeries class.

public PieSeries(SeriesLabel seriesLabel, float borderWidth, Color borderColor, Legend legend)
Public Sub New (seriesLabel As SeriesLabel, borderWidth As Single, borderColor As Color, legend As Legend)

Parameters​

SeriesLabel of the pie series.

Border width of the pie series.

Border Color of the pie series.

Legend of the pie series.

PieSeries(Single, Color)​

Initializes a new instance of the PieSeries class.

public PieSeries(float borderWidth, Color borderColor)
Public Sub New (borderWidth As Single, borderColor As Color)

Parameters​

Border width of the pie series.

Border Color of the pie series.

PieSeries(Single, Color, Legend)​

Initializes a new instance of the PieSeries class.

public PieSeries(float borderWidth, Color borderColor, Legend legend)
Public Sub New (borderWidth As Single, borderColor As Color, legend As Legend)

Parameters​

Border width of the pie series.

Border Color of the pie series.

Legend of the pie series.

Properties​

BorderColor​

Gets or sets the Color object to use for the borders of the PieSeries.

public Color BorderColor { get; set; }
Public Property BorderColor As Color

Property Value​

Color

BorderWidth​

Gets or sets the BorderWidth of the PieSeries.

public float BorderWidth { get; set; }
Public Property BorderWidth As Single

Property Value​

Single

DataLabel​

Gets or sets the ScalarDataLabel object to use for the data label of the Pie series. This is the default data label for the series.

public ScalarDataLabel DataLabel { get; set; }
Public Property DataLabel As ScalarDataLabel

Property Value​

ScalarDataLabel

DataLabelPosition​

Gets or sets ScalarDataLabelPosition enumeration that specifies the display position of the data label.

public ScalarDataLabelPosition DataLabelPosition { get; set; }
Public Property DataLabelPosition As ScalarDataLabelPosition

Property Value​

ScalarDataLabelPosition

DrawBehindAxis​

Gets or sets the position of the Series either below or above the axis. By default it is true. (Inherited from SeriesBase)

public bool DrawBehindAxis { get; set; }
Public Property DrawBehindAxis As Boolean

Property Value​

Boolean

Elements​

Gets the PieSeriesElementList object contained in the PieSeries.

public PieSeriesElementList Elements { get; }
Public Property Elements As PieSeriesElementList

Property Value​

PieSeriesElementList

Height​

Gets the height of the PieSeries.

public float Height { get; }
Public Property Height As Single

Property Value​

Single

Label​

Gets or sets the SeriesLabel object to use for the name of the PieSeries.

public SeriesLabel Label { get; set; }
Public Property Label As SeriesLabel

Property Value​

SeriesLabel

Legend​

Gets or sets the Legend object of the PlotAreaElement. (Inherited from PlotAreaElement)

public Legend Legend { get; set; }
Public Property Legend As Legend

Property Value​

Legend

PercentageFormat​

Gets or sets the format to use for the percentage of the ScalarDataLabel object.

public string PercentageFormat { get; set; }
Public Property PercentageFormat As String

Property Value​

String

PlotArea​

Gets the PlotArea object of the PlotAreaElement. (Inherited from PlotAreaElement)

public PlotArea PlotArea { get; }
Public Property PlotArea As PlotArea

Property Value​

PlotArea

Radius​

Gets or sets the radius of the PieSeries.

public float Radius { get; set; }
Public Property Radius As Single

Property Value​

Single

StartAngle​

Gets or sets the StartAngle of the PieSeries.

public float StartAngle { get; set; }
Public Property StartAngle As Single

Property Value​

Single

ValueFormat​

Gets or sets the format to use for the value of the ScalarDataLabel object.

public string ValueFormat { get; set; }
Public Property ValueFormat As String

Property Value​

String

Width​

Gets the width of the PieSeries.

public float Width { get; }
Public Property Width As Single

Property Value​

Single

X​

Gets the X coordinate of the PieSeries.

public float X { get; }
Public Property X As Single

Property Value​

Single

XOffset​

Gets or sets the XOffset of the PieSeries.

public float XOffset { get; set; }
Public Property XOffset As Single

Property Value​

Single

Y​

Gets the Y coordinate of the PieSeries.

public float Y { get; }
Public Property Y As Single

Property Value​

Single

YOffset​

Gets or sets the YOffset of the PieSeries.

public float YOffset { get; set; }
Public Property YOffset As Single

Property Value​

Single

Methods​

Equals(Object)​

Determines whether the specified Object is equal to the current Object . (Inherited from Object)

public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean

Parameters​

The Object to compare with the current Object .

Returns​

true if the specified Object is equal to the current Object ; otherwise, false.

GetHashCode()​

Serves as a hash function for a particular type. (Inherited from Object)

public int GetHashCode()
Function GetHashCode() As Integer

Returns​

A hash code for the current Object .

GetType()​

Gets the Type of the current instance. (Inherited from Object)

public Type GetType()
Function GetType() As Type

Returns​

The Type instance that represents the exact runtime type of the current instance.

SetArea(Single, Single, Single, Single)​

Set the area of the PieSeries.

public void SetArea(float x, float y, float width, float height)
Sub SetArea(x As Single, y As Single, width As Single, height As Single)

Parameters​

X coordinate of the pie series.

Y coordinate of the pie series.

Width of the pie series.

Height of the pie series.

ToString()​

Returns a String that represents the current Object . (Inherited from Object)

public string ToString()
Function ToString() As String

Returns​

A String that represents the current Object .

See Also​

ceTe.DynamicPDF.PageElements.Charting.Series