cete.dynamicpdf.pageelements.charting.series.pieserieselement
PieSeriesElement
- Namespace: ceTe.DynamicPDF.PageElements.Charting.Series
- Assemblies: ceTe.DynamicPDF.40.dll
Represents a PieSeriesElement.
public class PieSeriesElement : SeriesElement
Public Class PieSeriesElement
Inherits SeriesElement
Inheritance: Object → PlotAreaElement → SeriesElement → PieSeriesElement
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 series elements and adds it to 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 element and add values to it
Dim MySeriesElement1 As PieSeriesElement = New PieSeriesElement(27, "Website A")
Dim MySeriesElement2 As PieSeriesElement = New PieSeriesElement(19, "Website B")
Dim MySeriesElement3 As PieSeriesElement = New PieSeriesElement(21, "Website C")
' Create a pie series and add pie series elements to it
Dim MyPieSeries As PieSeries = New PieSeries()
MyPieSeries.Elements.Add(MySeriesElement1)
MyPieSeries.Elements.Add(MySeriesElement2)
MyPieSeries.Elements.Add(MySeriesElement3)
' Add the data label to the pie series
MyPieSeries.DataLabel = da
' Add the pie series to the plot area
MyPlotArea.Series.Add(MyPieSeries)
' 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 data label
ScalarDataLabel da = new ScalarDataLabel(true, false, false);
// Create a pie series element and add values to it
PieSeriesElement seriesElement1 = new PieSeriesElement(27, "Website A");
PieSeriesElement seriesElement2 = new PieSeriesElement(19, "Website B");
PieSeriesElement seriesElement3 = new PieSeriesElement(21, "Website C");
// Create a pie series and add pie series elements to it
PieSeries pieSeries = new PieSeries();
pieSeries.Elements.Add(seriesElement1);
pieSeries.Elements.Add(seriesElement2);
pieSeries.Elements.Add(seriesElement3);
// Add the data label to the pie series
pieSeries.DataLabel = da;
// Add the pie series to the plot area
plotArea.Series.Add(pieSeries);
// Add the chart to page and add the page to document
page.Elements.Add(chart);
// Draw the document
document.Draw(@"C:\MyDocument.pdf");
}
}
Constructors
PieSeriesElement(Single)
Initializes a new instance of the PieSeriesElement class.
public PieSeriesElement(float value1)
Public Sub New (value1 As Single)
Parameters
- value1: Single
Value of the pie series element.
PieSeriesElement(Single, ScalarDataLabel)
Initializes a new instance of the PieSeriesElement class.
public PieSeriesElement(float value1, ScalarDataLabel scalarDataLabel)
Public Sub New (value1 As Single, scalarDataLabel As ScalarDataLabel)
Parameters
- value1: Single
Value of the pie series element.
- scalarDataLabel: ScalarDataLabel
ScalarDataLabel of the pie series element.
PieSeriesElement(Single, String)
Initializes a new instance of the PieSeriesElement class.
public PieSeriesElement(float value1, string name)
Public Sub New (value1 As Single, name As String)
Parameters
- value1: Single
Value of the pie series element.
- name: String
Name of the pie series element.
PieSeriesElement(Single, String, Color)
Initializes a new instance of the PieSeriesElement class.
public PieSeriesElement(float value1, string name, Color color)
Public Sub New (value1 As Single, name As String, color As Color)
Parameters
- value1: Single
Value of the pie series element.
- name: String
Name of the pie series element.
- color: Color
Color of the pie series element.
PieSeriesElement(Single, String, Color, Legend)
Initializes a new instance of the PieSeriesElement class.
public PieSeriesElement(float value1, string name, Color color, Legend legend)
Public Sub New (value1 As Single, name As String, color As Color, legend As Legend)
Parameters
- value1: Single
Value of the pie series element.
- name: String
Name of the pie series element.
- color: Color
Color of the pie series element.
- legend: Legend
Legend of the pie series element.
Properties
BorderColor
Gets or sets the Color object to use for the borders of the PieSeriesElement.
public Color BorderColor { get; set; }
Public Property BorderColor As Color
Property Value
BorderWidth
Gets or sets the BorderWidth of the PieSeriesElement.
public float BorderWidth { get; set; }
Public Property BorderWidth As Single
Property Value
Color
Gets or sets the Color object to use for the color of the SeriesElement. (Inherited from SeriesElement)
public Color Color { get; set; }
Public Property Color As Color
Property Value
DataLabel
Gets or sets the ScalarDataLabel object to use for the data label of the PieSeriesElement.
public ScalarDataLabel DataLabel { get; set; }
Public Property DataLabel As ScalarDataLabel
Property Value
ExplodeLength
Gets or sets the ExplodeLength of the PieSeriesElement.
public float ExplodeLength { get; set; }
Public Property ExplodeLength As Single
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
LegendLabel
Gets the LegendLabel of the SeriesElement. (Inherited from SeriesElement)
public LegendLabel LegendLabel { get; }
Public Property LegendLabel As LegendLabel
Property Value
Name
Gets the name of the SeriesElement. (Inherited from SeriesElement)
public string Name { get; }
Public Property Name 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
Value
Gets or sets the value of the PieSeriesElement.
public float Value { get; set; }
Public Property Value 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.
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 .