NAME
VS::Chart::Renderer::XY - Base class for grafs that uses a XY planar coordinate system
DESCRIPTION
This class performs common rendering of stuff like chart background, grids and labels for XY planar coordinate charts.
ATTRIBUTES
BACKGROUND
- chart_background ( 0 | 1 | COLOR )
-
Controls if a chart_background should be drawn or not. Defaults to 1. Standard color is white.
BORDERS
- borders ( 0 | 1 | COLOR )
-
Controls if a 1 point border around the chart should be drawn or not. Defaults to 0. Standard color is black.
X AXIS
- x_axis ( 0 | 1 | COLOR )
-
Controls if the X axis should be drawn. Defaults to 1. Standard color is axis.
- x_grid ( 0 | 1 | COLOR ).
-
Controls if a vertical grid should be drawn. Defaults to 1. Standard color is grid.
- x_label_decimals ( NUM )
-
Controls how many decimals should be shown for X labels. Defaults to 0. If the labels isn't numeric this has no effect.
- x_labels ( 0 | 1 | COLOR )
-
Controls if labels on the X axis should be drawn. Defaults to 1. Standard color is text.
- x_minor_grid ( 0 | 1 | COLOR )
-
Controls if minor vertical grid should be drawn. Defaults to 0. Standard color is minor_tick.
- x_minor_ticks (0 | 1 | COLOR )
-
Controls if minor ticks (between lables / major ticks ) should be drawn. Defaults to 0. Standard color is minor_tick.
- x_minor_ticks_count ( NUM )
-
Controls the number of minor ticks (and minor grid lines) to show between major ticks.
- x_ticks ( 0 | 1 | COLOR )
-
Controls if major ticks (at labels) should be drawn. Defaults to 0. Standard color is major_tick.
Y AXIS
- show_y_min ( 0 | 1)
-
Controls if the minimum value for Y should be shown or not.
- y_grid ( 0 | 1 | COLOR )
-
Controls if a horizontal grid should be drawn. Defaults to 1. Standard color is grid.
- y_minor_grid ( 0 | 1 | COLOR )
-
Controls if a horizontal minor grid should be drawn. Defaults to 0. Standard color is minor_tick.
- y_steps ( NUM )
-
Controls how many steps on the Y axis should be shown.
- y_axis ( 0 | 1 | COLOR )
-
Controls if the Y axis should be drawn. Defaults to 1. Standard color is axis.
- y_labels ( 0 | 1 | COLOR )
-
Controls if labels on the X axis should be drawn. Defaults to 1. Standard color is text.
- y_label_decimals ( NUM )
-
Controls how many decimals should be shown for Y labels. Defaults to 1.
- y_major_ticks ( 0 | 1 | COLOR )
-
Controls if major ticks (at labels) should be drawn. Defaults to 0. Standard color is major_tick.
- y_minor_ticks (0 | 1 | COLOR )
-
Controls if minor ticks (between lables / major ticks ) should be drawn. Defaults to 0. Standard color is minor_tick.
- y_minor_ticks_count ( NUM )
-
Controls the number of minor ticks to show between major ticks/grid lines.
INTERFACE
CLASS METHODS
- set_defaults ( CHART )
-
Sets defaults attribute for the chart and returns a list of keys it's added. If an attribute already exists it's unaffected.
- render ( CHART, SURFACE )
-
Render CHART to SURFACE
- render_chart_background ( CHART, SURFACE, LEFT, TOP, WIDTH, HEIGHT )
-
Renders the charts background. This is the area on which the actually data will be drawn, and not the axes, labels or ticks. The WIDTH and HEIGHT are calculated by taking their respetive values minus any offsets.
- render_axes ( CHART, SURFACE, LEFT, TOP, WIDTH, HEIGHT )
-
Renders the axes, labels and ticks.
- x_offsets ( CHART, SURFACE )
-
Returns left and right offsets for the chart.
- y_offsets ( CHART, SURFACE )
-
Returns the top and bottom offsets for the chart.