Class Chart
XY chart renderer for PDF pages. See Example_26.
public class Chart : IDrawable
- Inheritance
-
Chart
- Implements
- Inherited Members
Constructors
Chart(Font, Font)
Creates an XY chart.
public Chart(Font f1, Font f2)
Parameters
Methods
AddSeries(string)
Adds a series and returns it, to add its points and set its line and marker. A series without a stroke color has the next color of the palette. The legend lists the series that have a name.
public Series AddSeries(string name)
Parameters
namestringthe series name, shown in the legend; empty for none.
Returns
- Series
the new Series object.
DrawOn(Page)
Draws this chart on the specified page.
public float[] DrawOn(Page page)
Parameters
pagePagethe page to draw on.
Returns
- float[]
the bottom-right corner coordinates [x, y].
SetAltDescription(string)
Sets the alternate description of the chart, which a screen reader reads in a PDF/UA document, where the chart is a figure. The default is the title, or "Chart" without one. Describe what the chart shows.
public Chart SetAltDescription(string altDescription)
Parameters
altDescriptionstringthe alternate description.
Returns
- Chart
this Chart object.
SetAxisLineWidth(float)
Sets the width of the axis lines, along the left and the bottom sides of the plot area. The default is 0.5; 0 hides them.
public Chart SetAxisLineWidth(float width)
Parameters
widthfloat
Returns
SetChartBorderWidth(float)
Sets the width of the outer chart border. A width of 0, the default, hides it.
public Chart SetChartBorderWidth(float width)
Parameters
widthfloat
Returns
SetDrawHorizontalGridLines(bool)
Toggles drawing of horizontal grid lines.
public Chart SetDrawHorizontalGridLines(bool drawHorizontalGridLines)
Parameters
drawHorizontalGridLinesbool
Returns
SetDrawLegend(bool)
Sets whether the legend is drawn. The legend lists the series that have a name, under the title, each with its line or its marker.
public Chart SetDrawLegend(bool drawLegend)
Parameters
drawLegendbooltrue to draw the legend.
Returns
- Chart
this Chart object.
SetDrawVerticalGridLines(bool)
Toggles drawing of vertical grid lines.
public Chart SetDrawVerticalGridLines(bool drawVerticalGridLines)
Parameters
drawVerticalGridLinesbool
Returns
SetDrawXAxisLabels(bool)
Sets whether the x axis labels are drawn.
public Chart SetDrawXAxisLabels(bool drawXAxisLabels)
Parameters
drawXAxisLabelsbool
Returns
SetDrawYAxisLabels(bool)
Toggles drawing of Y axis labels.
public Chart SetDrawYAxisLabels(bool drawYAxisLabels)
Parameters
drawYAxisLabelsbool
Returns
SetGridLineColor(int)
Sets the color of the grid lines. The default is black. Color.transparent leaves it unchanged.
public Chart SetGridLineColor(int color)
Parameters
colorintthe color as a 0xRRGGBB value, for example Color.lightgray.
Returns
- Chart
this Chart object.
SetHorizontalGridLineDashPattern(string)
Sets the horizontal grid line dash pattern (e.g. "[1 1] 0").
public Chart SetHorizontalGridLineDashPattern(string pattern)
Parameters
patternstring
Returns
SetHorizontalGridLineWidth(float)
Sets the width of the horizontal grid lines. A width of 0 draws the thinnest line a viewer shows; SetDrawHorizontalGridLines(false) hides them.
public Chart SetHorizontalGridLineWidth(float width)
Parameters
widthfloat
Returns
SetInnerBorderWidth(float)
Sets the width of the plot area border. A width of 0, the default, hides it.
public Chart SetInnerBorderWidth(float width)
Parameters
widthfloat
Returns
SetLocation(float, float)
Sets the top-left position. Returns this for chaining.
public Chart SetLocation(float x, float y)
Parameters
Returns
SetMaximumFractionDigits(int)
Sets the maximum number of decimal places in the axis labels. The default is 2.
public Chart SetMaximumFractionDigits(int maxFractionDigits)
Parameters
maxFractionDigitsint
Returns
SetMinimumFractionDigits(int)
Sets the minimum number of decimal places in the axis labels. The labels of an axis have at least the decimal places of its step, so an axis with a whole number step has whole number labels. The default is 0.
public Chart SetMinimumFractionDigits(int minFractionDigits)
Parameters
minFractionDigitsint
Returns
SetSize(float, float)
Sets the chart dimensions.
public Chart SetSize(float w, float h)
Parameters
Returns
SetSubtitle(string)
Sets the subtitle, written in gray under the title in the second font.
public Chart SetSubtitle(string subtitle)
Parameters
subtitlestringthe subtitle.
Returns
- Chart
this Chart object.
SetTitle(string)
Sets the chart title.
public Chart SetTitle(string title)
Parameters
titlestring
Returns
SetVerticalGridLineDashPattern(string)
Sets the vertical grid line dash pattern (e.g. "[1 1] 0").
public Chart SetVerticalGridLineDashPattern(string pattern)
Parameters
patternstring
Returns
SetVerticalGridLineWidth(float)
Sets the width of the vertical grid lines. A width of 0 draws the thinnest line a viewer shows; SetDrawVerticalGridLines(false) hides them.
public Chart SetVerticalGridLineWidth(float width)
Parameters
widthfloat
Returns
SetXAxisMinMax(float, float, int)
Sets the X axis range and its number of grid lines. With 0 grid lines, the default, the range is the range of the data rounded to "nice" values, and xMin and xMax are not used; a negative number is taken as 0.
public Chart SetXAxisMinMax(float xMin, float xMax, int xAxisGridLines)
Parameters
Returns
- Chart
this Chart object.
SetXAxisTitle(string)
Sets the X axis title.
public Chart SetXAxisTitle(string title)
Parameters
titlestring
Returns
SetYAxisMinMax(float, float, int)
Sets the Y axis range and its number of grid lines. With 0 grid lines, the default, the range is the range of the data rounded to "nice" values, and yMin and yMax are not used; a negative number is taken as 0.
public Chart SetYAxisMinMax(float yMin, float yMax, int yAxisGridLines)
Parameters
Returns
- Chart
this Chart object.
SetYAxisTitle(string)
Sets the Y axis title.
public Chart SetYAxisTitle(string title)
Parameters
titlestring