cete.dynamicpdf.pageelements.charting.series.pieseries
PieSeries
- Namespace: ceTe.DynamicPDF.PageElements.Charting.Series
- Assemblies: ceTe.DynamicPDF.40.dll
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 datalabel
Dim da As ScalarDataLabel = New ScalarDataLabel(True, False, False)
' Create a pieseries and set datalabel to the pieseries
Dim MyPieSeries As PieSeries = New PieSeries()
MyPieSeries.DataLabel = da
' Add the elements to the plotarea
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;
class MyClass
{
static void Main()
{
// 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 datalabel
ScalarDataLabel da = new ScalarDataLabel(true, false, false);
// Create a pieseries and set datalabel to the pieseries
PieSeries pieSeries = new PieSeries();
pieSeries.DataLabel = da;
// Add the elements to the plotarea
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(@"C:\MyDocument.pdf");
}
}
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: Legend
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: SeriesLabel
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: SeriesLabel
SeriesLabel of the pie series.
- borderWidth: Single
Border width of the pie series.
- borderColor: Color
Border Color of the pie series.
- legend: Legend
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
- borderWidth: Single
Border width of the pie series.
- borderColor: Color
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
- borderWidth: Single
Border width of the pie series.
- borderColor: Color
Border Color of the pie series.
- legend: Legend
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
BorderWidth
Gets or sets the BorderWidth of the PieSeries.
public float BorderWidth { get; set; }
Public Property BorderWidth As Single
Property Value
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
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
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
Elements
Gets the PieSeriesElementList object contained in the PieSeries.
public PieSeriesElementList Elements { get; }
Public Property Elements As PieSeriesElementList
Property Value
Height
Gets the height of the PieSeries.
public float Height { get; }
Public Property Height As Single
Property Value
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
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
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
PlotArea
Gets the PlotArea object of the PlotAreaElement. (Inherited from PlotAreaElement)
public PlotArea PlotArea { get; }
Public Property PlotArea As PlotArea
Property Value
Radius
Gets or sets the radius of the PieSeries.
public float Radius { get; set; }
Public Property Radius As Single
Property Value
StartAngle
Gets or sets the StartAngle of the PieSeries.
public float StartAngle { get; set; }
Public Property StartAngle As Single
Property Value
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
Width
Gets the width of the PieSeries.
public float Width { get; }
Public Property Width As Single
Property Value
X
Gets the X coordinate of the PieSeries.
public float X { get; }
Public Property X As Single
Property Value
XOffset
Gets or sets the XOffset of the PieSeries.
public float XOffset { get; set; }
Public Property XOffset As Single
Property Value
Y
Gets the Y coordinate of the PieSeries.
public float Y { get; }
Public Property Y As Single
Property Value
YOffset
Gets or sets the YOffset of the PieSeries.
public float YOffset { get; set; }
Public Property YOffset As Single
Property Value
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
- obj: Object
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: Single
X coordinate of the pie series.
- y: Single
Y coordinate of the pie series.
- width: Single
Width of the pie series.
- height: Single
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 .