Table of Contents

Class SimpleScatterChart

Namespace
PDFjet.NET
Assembly
PDFjet.dll

A chart of points on two axes that shows how two values go together: many points as small gray dots, a little transparent so that a cluster shows darker, a few of them highlighted, navy and labeled with their names beside them, and the trend line of the points if asked, labeled at its end. A light horizontal grid alone, no border or legend, on a light panel, with a title and a subtitle at the top left, in the look of SimpleBarChart. Any point can be a link, a dot with a description that a hover or a screen reader gets, so that all of 200 points are links without a name printed for each. A point outside a range that is set is not drawn, and the chart says how many are: "2 points outside the range", small, under the plot at its right end, and in its description, in that alone when the plot would not be left room to draw.

In a PDF/UA document the chart is one figure, described from its data: the number of points, the highlighted ones and their values, which way the trend goes and the points outside a range, unless an alternate description is set, which is then followed by those points alone. It draws with the page alone, and needs no other chart. In PDF/A-1, which has no transparency, the dots are drawn opaque. Please see Example_26.

public class SimpleScatterChart : IDrawable
Inheritance
SimpleScatterChart
Implements
Inherited Members

Constructors

SimpleScatterChart(Font, Font)

Creates a simple scatter chart, 400 by 300 points.

public SimpleScatterChart(Font f1, Font f2)

Parameters

f1 Font

the font of the title and of the names of the highlighted points, a bold one.

f2 Font

the font of the subtitle, the axis titles and the numbers.

Methods

Add(float, float)

Adds a point, drawn as a small gray dot. A point whose x or y is not a number is left out.

public SimpleScatterChart Add(float x, float y)

Parameters

x float

the x of the point.

y float

the y of the point.

Returns

SimpleScatterChart

this chart.

Add(string, float, float)

Adds a point that is highlighted: a navy dot with its name beside it.

public SimpleScatterChart Add(string name, float x, float y)

Parameters

name string

the name of the point.

x float

the x of the point.

y float

the y of the point.

Returns

SimpleScatterChart

this chart.

Add(string, float, float, string)

Adds a point that is highlighted and is a link: a navy dot with its name beside it, both of them the link to the URI. In a PDF/UA document each such point is a figure of its own, described by its name, in the Link that holds its annotation, as PDF/UA asks.

public SimpleScatterChart Add(string name, float x, float y, string uri)

Parameters

name string

the name of the point.

x float

the x of the point.

y float

the y of the point.

uri string

the URI the point links to.

Returns

SimpleScatterChart

this chart.

AddLinkedDot(string, float, float, string)

Adds a point that is a link and not highlighted: a dot as Add(x, y) draws it, in its series if any, with nothing beside it. Its name is not printed: it is the description of the link, and in a PDF/UA document that of a figure of its own in the Link that holds its annotation, as with Add(name, x, y, uri), and it counts in the description of the chart as a point of Add(x, y) does. The link is at least 8 points square around the dot, so that it can be hit, and inside the page. A name left empty is described by the URI; a URI left empty is no link.

public SimpleScatterChart AddLinkedDot(string name, float x, float y, string uri)

Parameters

name string

the description of the point.

x float

the x of the point.

y float

the y of the point.

uri string

the URI the point links to.

Returns

SimpleScatterChart

this chart.

AddSeries(string)

Starts a series: the points added after it are its points, drawn in its color and its shape, and its name is in the legend over the plot. The series take the colors of the palette of BarChart, blue, orange, red, teal and so on, and the shapes circle, square, triangle, star, diamond and cross, in turn. The points added before the first series are gray dots, as those of a chart without series.

public SimpleScatterChart AddSeries(string name)

Parameters

name string

the name of the series, in the legend.

Returns

SimpleScatterChart

this chart.

DrawOn(Page)

Draws the chart on the page. A chart too small for its plot and its numbers draws nothing.

public float[] DrawOn(Page page)

Parameters

page Page

the page to draw on.

Returns

float[]

the x and y coordinates of the bottom right corner of the chart.

SetAltDescription(string)

Sets the alternate description of the chart in a PDF/UA document. Without one the chart is described from its data. The number of points outside a range that is set follows it, as the chart prints it.

public SimpleScatterChart SetAltDescription(string altDescription)

Parameters

altDescription string

the alternate description.

Returns

SimpleScatterChart

this chart.

SetDotColor(int)

Sets the color of the points that are not highlighted. It is gray, 0x8C96A3, unless set.

public SimpleScatterChart SetDotColor(int color)

Parameters

color int

the color.

Returns

SimpleScatterChart

this chart.

SetHighlightColor(int)

Sets the color of the highlighted points and of their names. It is navy, 0x1F3A5F, unless set.

public SimpleScatterChart SetHighlightColor(int color)

Parameters

color int

the color.

Returns

SimpleScatterChart

this chart.

SetLocation(float, float)

Sets the top left corner of the chart.

public SimpleScatterChart SetLocation(float x, float y)

Parameters

x float

the x coordinate.

y float

the y coordinate.

Returns

SimpleScatterChart

this chart.

SetPanelColor(int)

Sets the color of the panel behind the chart. It is light gray, 0xF1F3F6, unless set. Color.transparent, -1, draws no panel: the one color setter where it does not leave the color as it was.

public SimpleScatterChart SetPanelColor(int color)

Parameters

color int

the color.

Returns

SimpleScatterChart

this chart.

SetSize(float, float)

Sets the width and the height of the chart.

public SimpleScatterChart SetSize(float w, float h)

Parameters

w float

the width.

h float

the height.

Returns

SimpleScatterChart

this chart.

SetSubtitle(string)

Sets the subtitle, drawn small and gray under the title.

public SimpleScatterChart SetSubtitle(string subtitle)

Parameters

subtitle string

the subtitle.

Returns

SimpleScatterChart

this chart.

SetTitle(string)

Sets the title, drawn at the top left of the chart.

public SimpleScatterChart SetTitle(string title)

Parameters

title string

the title.

Returns

SimpleScatterChart

this chart.

SetTrendLine(bool)

Draws the trend line of the points, their least squares line, thin and dark gray, labeled "trend" at its right end.

public SimpleScatterChart SetTrendLine(bool trendLine)

Parameters

trendLine bool

true to draw it.

Returns

SimpleScatterChart

this chart.

SetXAxisRange(float, float)

Sets the range of the horizontal axis. Without it the range is that of the points, rounded to steps. A range whose end is not past its start is not set. A point outside the range is not drawn, and the chart says how many are, under the plot, which is that much lower, and in its description.

public SimpleScatterChart SetXAxisRange(float min, float max)

Parameters

min float

the first value of the axis.

max float

the last value of the axis.

Returns

SimpleScatterChart

this chart.

SetXAxisTitle(string)

Sets the title of the horizontal axis, drawn under it.

public SimpleScatterChart SetXAxisTitle(string title)

Parameters

title string

the title.

Returns

SimpleScatterChart

this chart.

SetYAxisRange(float, float)

Sets the range of the vertical axis. Without it the range is that of the points, rounded to steps. A range whose end is not past its start is not set. A point outside the range is not drawn, and the chart says how many are, under the plot, which is that much lower, and in its description.

public SimpleScatterChart SetYAxisRange(float min, float max)

Parameters

min float

the first value of the axis.

max float

the last value of the axis.

Returns

SimpleScatterChart

this chart.

SetYAxisTitle(string)

Sets the title of the vertical axis, drawn up its left side.

public SimpleScatterChart SetYAxisTitle(string title)

Parameters

title string

the title.

Returns

SimpleScatterChart

this chart.