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
stringThe type of chart. Use one of: 'Bars', 'Columns', 'StackedBars', 'StackedBars100', 'StackedColumns', 'StackedColumns100', 'Lines', 'StackedLines', 'StackedLines100', 'ColumnsAndLines', 'FloatingBars', 'FloatingColumns', 'FloatingColumnsAndLines', 'XY'
pWidth
intThe width of the output image in pixels.
pHeight
intThe height of the output image in pixels.
pBackgroundColor
intThe background color of the chart area.
pCaption
stringThe caption for the chart.
Fields
BorderColor
Gets/sets the border color of the chart as Windows color.
public int BorderColor
Field Value
FillColor
Gets/sets the fill color of the chart as Windows color.
public int FillColor
Field Value
vbBlack
Windows color 'Black'
public const int vbBlack = 0
Field Value
vbWhite
Windows color 'White'
public const int vbWhite = 16777215
Field Value
Properties
BarSpacing
Gets/sets the spacing of the bars withing series in pixels.
public double BarSpacing { get; set; }
Property Value
BarSpacingSeries
Gets/sets the spacing of bars between series in pixels.
public double BarSpacingSeries { get; set; }
Property Value
Caption
Gets/sets the caption of the chart.
public string Caption { get; set; }
Property Value
CaptionFont
Returns the font object used for the caption.
public PolarFont CaptionFont { get; }
Property Value
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
Height
Gets/sets the height of the chart in pixels.
public int Height { get; set; }
Property Value
Legend
Returns the Legend object.
public Ledgend Legend { get; }
Property Value
Margin
Gets/sets the width of the margins in pixels.
public int Margin { get; set; }
Property Value
Series
Returns all the series in the chart.
public Collection<Series> Series { get; }
Property Value
SubCaption
Gets/sets the sub caption.
public string SubCaption { get; set; }
Property Value
SubCaptionFont
Returns the font object used for the sub caption.
public PolarFont SubCaptionFont { get; }
Property Value
Width
Gets/sets the width of the chart in pixels.
public int Width { get; set; }
Property Value
Xaxis
Returns the Xaxis object.
public Axis Xaxis { get; }
Property Value
Yaxis
Returns the Yaxis object.
public Axis Yaxis { get; }
Property Value
Zaxis
Returns the Zaxis object.
public Axis Zaxis { get; }
Property Value
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
stringThe 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
stringThe contents of the barcode. Asterixes are added automatically if needed.
pBarCodeType
stringThe type of barcode use one of '3-of-9' or '128'
pHeight
intThe height in pixels of the barcode.
pAddText
boolPass as True to add the specified text underneath the barcode.
pBarWidthFactor
intThe 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
stringThe text to put in the QR code.
pQRCodeTypeNumber
intThe size of the QR code. Use 1-40 or leave empty to automatically detect. Will automatically be increased if size is insufficient.
pBlockWidthFactor
intThe size in pixels of a single square.
pErrorCorrectionLevel
stringThe 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
intThe 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.