Table of Contents

Class Chart

Namespace
PolarChart
Assembly
PolarChart.dll

This class is used to create simple charts that can be written to an image.

public class Chart : IDisposable
Inheritance
Chart
Implements
Inherited Members
Extension Methods

Constructors

Chart()

Default constructor.

public Chart()

Chart(string, int, int, int, string)

Constructor for a specific chart type.

public Chart(string pChartType, int pWidth = 0, int pHeight = 0, int pBackgroundColor = 16777215, string pCaption = "")

Parameters

pChartType string

The type of chart. Use one of: 'Bars', 'Columns', 'StackedBars', 'StackedBars100', 'StackedColumns', 'StackedColumns100', 'Lines', 'StackedLines', 'StackedLines100', 'ColumnsAndLines', 'FloatingBars', 'FloatingColumns', 'FloatingColumnsAndLines', 'XY'

pWidth int

The width of the output image in pixels.

pHeight int

The height of the output image in pixels.

pBackgroundColor int

The background color of the chart area.

pCaption string

The caption for the chart.

Fields

BorderColor

Gets/sets the border color of the chart as Windows color.

public int BorderColor

Field Value

int

FillColor

Gets/sets the fill color of the chart as Windows color.

public int FillColor

Field Value

int

vbBlack

Windows color 'Black'

public const int vbBlack = 0

Field Value

int

vbWhite

Windows color 'White'

public const int vbWhite = 16777215

Field Value

int

Properties

BarSpacing

Gets/sets the spacing of the bars withing series in pixels.

public double BarSpacing { get; set; }

Property Value

double

BarSpacingSeries

Gets/sets the spacing of bars between series in pixels.

public double BarSpacingSeries { get; set; }

Property Value

double

Caption

Gets/sets the caption of the chart.

public string Caption { get; set; }

Property Value

string

CaptionFont

Returns the font object used for the caption.

public PolarFont CaptionFont { get; }

Property Value

PolarFont

ChartType

Gets/sets the chart type. Use one of: 'Bars', 'Columns', 'StackedBars', 'StackedBars100', 'StackedColumns', 'StackedColumns100', 'Lines', 'StackedLines', 'StackedLines100', 'ColumnsAndLines', 'FloatingBars', 'FloatingColumns', 'FloatingColumnsAndLines', 'XY'

public string ChartType { get; }

Property Value

string

Height

Gets/sets the height of the chart in pixels.

public int Height { get; set; }

Property Value

int

Legend

Returns the Legend object.

public Ledgend Legend { get; }

Property Value

Ledgend

Margin

Gets/sets the width of the margins in pixels.

public int Margin { get; set; }

Property Value

int

Series

Returns all the series in the chart.

public Collection<Series> Series { get; }

Property Value

Collection<Series>

SubCaption

Gets/sets the sub caption.

public string SubCaption { get; set; }

Property Value

string

SubCaptionFont

Returns the font object used for the sub caption.

public PolarFont SubCaptionFont { get; }

Property Value

PolarFont

Width

Gets/sets the width of the chart in pixels.

public int Width { get; set; }

Property Value

int

Xaxis

Returns the Xaxis object.

public Axis Xaxis { get; }

Property Value

Axis

Yaxis

Returns the Yaxis object.

public Axis Yaxis { get; }

Property Value

Axis

Zaxis

Returns the Zaxis object.

public Axis Zaxis { get; }

Property Value

Axis

Methods

AddCaptions()

Adds a captions-series to the chart.

public Series AddCaptions()

Returns

Series

A captions-series.

AddSeries(string)

Adds a series to a chart.

public Series AddSeries(string pSeriesName = "")

Parameters

pSeriesName string

The unique name of the series. If empty, it will be called 'Series_{x}'

Returns

Series

The new series.

CreateBarCode(string, string, int, bool, int)

Returns a PNG image containing the barcode with the given specifications.

public static string CreateBarCode(string pBarCodeText, string pBarCodeType = "", int pHeight = 0, bool pAddText = false, int pBarWidthFactor = 0)

Parameters

pBarCodeText string

The contents of the barcode. Asterixes are added automatically if needed.

pBarCodeType string

The type of barcode use one of '3-of-9' or '128'

pHeight int

The height in pixels of the barcode.

pAddText bool

Pass as True to add the specified text underneath the barcode.

pBarWidthFactor int

The width of the smallest bar in pixels.

Returns

string

The binary string containing the PNG image for the barcode.

CreateQRCode(string, int, int, string)

Creates a PNG image for the specified text.

public static string CreateQRCode(string pQRcodeText, int pQRCodeTypeNumber = 0, int pBlockWidthFactor = 0, string pErrorCorrectionLevel = "")

Parameters

pQRcodeText string

The text to put in the QR code.

pQRCodeTypeNumber int

The size of the QR code. Use 1-40 or leave empty to automatically detect. Will automatically be increased if size is insufficient.

pBlockWidthFactor int

The size in pixels of a single square.

pErrorCorrectionLevel string

The type of error-correction. Use 'L', 'M', 'Q', 'H'

Returns

string

The binary data as string of the png image.

Dispose()

Used to free the resources.

public void Dispose()

~Chart()

protected ~Chart()

GetJPGstream(int)

Gets the chart as JPG image.

public string GetJPGstream(int pQuality = 90)

Parameters

pQuality int

The quality of the image (1-99). Higher is better quality but larger file size.

Returns

string

A binary string with the JPG image data.

GetPNGstream()

Gets the chart as PNG image.

public string GetPNGstream()

Returns

string

A binary string with the PNG image data.