Skip to main content

ScalarDataLabel

Version: 7.0

cete.dynamicpdf.pageelements.charting.scalardatalabel

ScalarDataLabel​

This class represents the ScalarDataLabel.

public class ScalarDataLabel
Public Class ScalarDataLabel

Inheritance: Object → ScalarDataLabel

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 with the scalar data label.

Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Charting
Imports ceTe.DynamicPDF.PageElements.Charting.Series
Imports ceTe.DynamicPDF.PageElements.Charting.Values
Imports ceTe.DynamicPDF.PageElements.Charting.Axes

Module MyModule

Sub Main()

' Create a PDF Document
Dim MyDocument As Document = New Document()

' Create a Page
Dim MyPage As Page = New Page(PageSize.A4, PageOrientation.Landscape)

' 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 scalar datalabel
Dim da As ScalarDataLabel = New ScalarDataLabel(True, False, False)

' Create a pieseries and add datalabel to the pieseries
Dim MyPieSeries As PieSeries = New PieSeries()
MyPieSeries.DataLabel = da

' Add the series and 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)
MyDocument.Pages.Add(MyPage)

' 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;
using ceTe.DynamicPDF.PageElements.Charting.Values;
using ceTe.DynamicPDF.PageElements.Charting.Axes;

class MyClass
{
static void Main()
{
// Create a PDF Document
Document document = new Document();

// Create a Page
Page page = new Page(PageSize.A4, PageOrientation.Landscape);

// 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 scalar datalabel
ScalarDataLabel da = new ScalarDataLabel(true, false, false);

// Create a pieseries and add datalabel to the pieseries
PieSeries pieSeries = new PieSeries();
pieSeries.DataLabel = da;

// Add the series and 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);
document.Pages.Add(page);

// Draw the document
document.Draw(@"C:\MyDocument.pdf");
}
}

Constructors​

ScalarDataLabel(Boolean)​

Initializes a new instance of the ScalarDataLabel class.

public ScalarDataLabel(bool showValue)
Public Sub New (showValue As Boolean)

Parameters​

Visible status of the pie series element value.

ScalarDataLabel(Boolean, Boolean)​

Initializes a new instance of the ScalarDataLabel class.

public ScalarDataLabel(bool showValue, bool showElement)
Public Sub New (showValue As Boolean, showElement As Boolean)

Parameters​

Visible status of the pie series element value.

Visible status of the pie series element name.

ScalarDataLabel(Boolean, Boolean, Boolean)​

Initializes a new instance of the ScalarDataLabel class.

public ScalarDataLabel(bool showValue, bool showPercentage, bool showElement)
Public Sub New (showValue As Boolean, showPercentage As Boolean, showElement As Boolean)

Parameters​

Visible status of the pie series element value.

Visible status of the pie series element value in percentage.

Visible status of the pie series element name.

ScalarDataLabel(Font, Single, Color, Boolean)​

Initializes a new instance of the ScalarDataLabel class.

public ScalarDataLabel(Font font, float fontSize, Color color, bool showValue)
Public Sub New (font As Font, fontSize As Single, color As Color, showValue As Boolean)

Parameters​

Font of the scalar data label.

Size of the scalar data label.

Color of the scalar data label.

Visible status of the pie series element value.

Properties​

Color​

Gets or sets the Color object to use for the color of the ScalarDataLabel.

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

Property Value​

Color

Font​

Gets or sets the Font object to use for the font of the ScalarDataLabel.

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

Property Value​

Font

FontSize​

Gets or sets the FontSize of the ScalarDataLabel.

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

Property Value​

Single

Prefix​

Gets or sets the prefix of the ScalarDataLabel.

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

Property Value​

String

Seperator​

Gets or sets the separator of the ScalarDataLabel.

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

Property Value​

String

ShowElement​

Gets or sets the visible status of the PieSeriesElement name. By default it is false.

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

Property Value​

Boolean

ShowPercentage​

Gets or sets the visible status of the PieSeriesElementValue as a percentage. By default it is false.

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

Property Value​

Boolean

ShowValue​

Gets or sets the visible status of the PieSeriesElementValue. By default it is false.

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

Property Value​

Boolean

Suffix​

Gets or sets the suffix of the ScalarDataLabel.

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

Property Value​

String

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.

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