APLX Help : System Classes : The Chart and Series Objects : Chart Object Properties
|
|||||||||||||||||||
![]() |
Chart Object Properties |
||||||||||||||||||
Setting the chart type:The
Selects a Line Chart. Each
series is drawn as lines between successive X, Y points. By default,
markers are not shown at each point. (If you want markers, set the
Selects a Stair Chart. Same as a Line chart, except that instead of the line being drawn directly from each X,Y point to the next, a horizontal line is drawn first to the next X position, and then a vertical line is drawn to the next Y position. This sort of chart is useful for displaying series where the Y values change in step-wise fashion (for example, a chart of interest rates set by a central bank against time, or a chart showing a digital representation of an analog value). Selects an Area Chart. Similar
to a line chart, except that each series is drawn as a filled area
between the lines connecting the X,Y points, and the X axis. The
series are drawn in the order in which they were created, so a later
series may conceal some or all of an earlier series. You can specify
the color and fill pattern for each series individually, or leave the
Chart object to select a default. (Tip: If you want to avoid
concealing one series underneath another, you can set the
Selects a Scatter Chart. No
line is drawn between the X,Y points of the series; instead, a marker
is drawn at each X,Y point. You can leave the Chart object to choose
a default marker type, or specify it yourself using the This
sort of chart is useful for displaying experimental results.
(Sometimes, you will also want to include a separate line series
showing a theoretical fit to the experimental results, or a
least-squares regression to show a trend. You can do this using the
Selects a Bar Chart. The
graph is drawn as a series of filled vertical bars from the X axis.
(The X values are ignored, except possibly to set labels for the
bars). If you have more than one series, the bars for each series
are displayed side-by-side. As with the other chart types, you can
set the fill color and/or pattern individually for each series, or
leave the Chart object to choose defaults. You can also set the
thickness of each bar (relative to the available space) using the
Selects a Stacked Bar Chart. Like a bar chart, but the bars for each series are placed on top of each other at each data point, rather than side-by-side. This type of chart is useful for showing both the total value of a quantity (for example, total sales by quarter), and the contributions to the total (for example, how much each region contributed to the total). Normally, stacked bar charts are used only for series where all the Y data values are positive. If there are negative Y values encountered at a given X value, there will in effect be two stacked bars drawn; the positive ones will be stacked on top of each other in the positive direction, and the negative ones will be stacked on top of each other in the negative direction. Selects a Horizontal Bar Chart. Same as a Bar chart, except that the bars are drawn horizontally. Selects a Horizontal stacked bar chart. Same as a Stacked Bar chart, except that the bars are drawn horizontally. Selects a High-Low-Open-Close
(HLOC) chart. Unlike
the previous chart types, for an HLOC chart you need to specify more
than one Y value for each X value for a series. As a minimum, you
should specify the High and Low values (using the properties
Although primarily used for financial data, this type of chart can also be used for other applications, such as displaying experimental results. In this case, the Open and Close values would both be specified to represent the primary experimental results, with the High and Low values representing the confidence limits. Selects a Candlestick chart. This is a variant of the High-Low-Open-Close chart. Again, a line is drawn between the High and Low values, but the difference between the Open and Close values is shown by a rectangle. If the Open value is greater than the Close, the rectangle is filled with the series foreground color, otherwise it is filled with the background color. This type of chart is often used to show price trends over time; the filled rectangles make it very obvious whether the closing prices were higher or lower than the opening prices for each trading period. Selects a Pie chart. Draws one or more circular areas, where each value is shown as a slice of the circle representing the proportion of the total attributable to each series. As such, they are rather like stacked bar charts, except that you cannot tell the total value at each point, only the proportion contributed by each series. Negative values are ignored. If there are multiple pie charts displayed, they are automatically arranged in rows and columns to make the best use of the available space. Each pie will have the same radius. By
default, the pie chart will be accompanied by a 'legend'
which shows the colors used for each series (provided you have
specified a Caution:
The Chart object displays one pie chart for each X value,
with each series contributing a slice to each pie (unless the value
is zero or negative). It does NOT display one pie per series. Thus,
in the limiting case where you want a single pie showing four
segments, you need to create four separate series, each with just one
value. Although this may seem somewhat unnatural at first, it is
implemented in this way for consistency with other chart types
(especially bars and stacked bars). This means you can swap between
the different chart types to display the same data in different ways.
This approach also allows you to set the color, fill pattern and
caption for each segment by setting properties of the Series objects.
The You
can label the individual pies by setting Selects a Mixed chart type, with different types for each Series. For all of the Chart types above, each series in the chart in displayed in the same way. Sometimes, however, you might want to mix different types of chart together. For example, you might want to show experimental results as a Scatter chart, and the prediction of a mathematical model of the data as a Line chart. Or you might want to show monthly profit figures as a Bar chart, and the cumulative year-to-date profit as a Line chart. If
you set the Setting titles and labels:
These
properties are all text vectors, and are simply labels displayed
around the chart. Normally, the
These properties are also text vectors, and are labels displayed adjacent to the axes. They are usually used to indicate the units or meaning of the scale along the axis. Specifying where labels and legends are drawn:
These properties determine where various labels of the chart are drawn. The
The
The
Choosing fonts:The
Note: Take care when changing this property to use a font which displays well at a wide range of sizes, unless the chart is not resizable. We recommend that you use a TrueType or OpenType font in all cases.
These
properties allow you to specify the font for individual elements of
the chart. Any changes you make to these override the setting of the
base These
properties are specified in a similar way to ordinary If
the Font name is an empty vector, the base font family is used. If
the Size or Style element is Specifying ticks, tick labels, and intercepts:
By default, the Chart object chooses a suitable scale automatically, and chooses sensible major and minor tick positions. It labels the major tick positions with the corresponding numeric value. These properties allow you to specify your own positions for the major or minor ticks along the X axis, Y axis, and alternate Y axis (if used). Each property is a numeric vector, specifying where each tick should be drawn. If both the major and minor tick vectors for a particular axis are empty (which is the default), the Chart object will position the tick marks automatically. If either the major or minor tick vector is not empty, ticks will be drawn only where you have specified them. If you specify your own tick positions, the scale for a particular axis will usually range from the lowest tick mark you specify to the highest. However, it will be extended to include any data point which would otherwise fall outside the range.
These properties can be used to change the labels written next to the major tick marks. By default, the Chart object labels the major ticks with the corresponding numeric value. If you specify one of these properties, then your labels will be used instead. However, (except for the X axis of a bar chart or pie chart), you must also specify the corresponding major tick positions, otherwise the Chart object will not know where the labels should be placed. The labels can be specified either as a character vector with embedded carriage returns, or as a text matrix, or as a nested vector of character vectors. The first label is used for the first major tick position, and so on. If there are more labels specified than tick positions, the surplus labels are ignored. If there are fewer, the ticks which do not have user-defined labels are labelled with the default numeric value.
These are Boolean scalar properties. If set to 0 (which is the default), a normal linear scale applies. If set to 1, a logarithmic scale is used for the corresponding axis. You cannot set a logarithmic scale for an axis where any data point is 0 or negative. If this situation occurs, the scale will revert to linear.
These properties can be used to specify where the X axis and main Y axis should cross the other axis. By default the X axis is placed at the bottom edge of the graph, or at the Y value of 0 if the Y axis ranges from negative to positive values, but you can specify a different position by changing the yintercept property. Similarly, the Y axis is by default placed at the left edge of the graph, or at X value 0 if the X axis ranges from negative to positive values, but you can specify a different value using the xintercept property. Returns the X position where the alternate Y axis (if any) crosses the X axis. Because the alternate Y axis is always drawn on the right-hand edge of the chart, this property is read-only.
These are read-only properties, each comprising a two-element numeric vector. They return the limits of the X, Y and Alternate Y axes respectively. Changing the appearance of the chart:The
The default is 0. The
Normally,
charts are drawn in color, with different series being drawn in
different colors to distinguish them. Sometimes, however, you may
want the chart to be drawn in monochrome, for example if you are
printing it on a black-and-white printer. The
The
When
the Chart is drawn, the control is first set to the Background color
(unless it is transparent), and then the various graphics elements
are drawn. By default, the axes, grids, labels and titles are all
drawn in the Foreground color, but you can change this using more
specific properties (see below). The data lines, markers, bars, or
pie slices for each series are drawn in the color associated with the
series (or in the Foreground color if the
These
properties allow you to set specific colors for the various
individual elements of the chart. They are specified as a single
color value (vector of three separate RGB values, or a single integer
encoding the three values). The default is The
These
two properties allow you to specify the line width (in pixels) for
the axis and grid lines respectively, as an integer scalar. The
default is The
This
property sets the space which the Chart object leaves around the
chart. (In addition to this, the Chart object automatically allows
extra space for the titles, legend, axis labels, and tick labels.)
It is a numeric vector of four elements, representing the Left,
Right, Top and Bottom margins, in the units set by the standard When
you use the Other properties:This
is a read-only property. It returns a vector of four numbers,
representing the Top Left Bottom Right of the data area of the graph
within the control (i.e. the area enclosed by the axes, excluding any
margin, titles, legend, or axis labels). It is expressed in the
units set by the standard Normally,
any changes you make to the chart take effect almost immediately
(when events are next processed). In some cases, this might give a
flickering effect if the chart ends up being redrawn several times because
you are making a lot of changes to it. You can temporarily disable redraws
by setting the The The This read-only property returns the representation of the chart in Scalable Vector Graphics (SVG) format. This format is ideal for publishing your charts, since SVG will retain high-quality output on high-resolution devices. |
|||||||||||||||||||
APLX Help : System Classes : The Chart and Series Objects : Chart Object Properties
|
Copyright © 1996-2010 MicroAPL Ltd