Functions
Create a bar chart from the specified data and return the SVG markup
create_bar_chart(array $data, string $x_label = 'X axis'
, string $y_label = 'Y axis'
, string $x_units = ''
, string $y_units = ''
) : string
Parameters
$data
array
The data to be used in the creation of the bar chart
$x_label
string
The X axis label
$y_label
string
The Y axis label
$x_units
string
The X axis units label
$y_units
string
The Y axis units label
Returns
string
The SVG markup for the described bar chart
Draw a pie chart with the specified data and return the SVG markup
create_pie_chart(array $data) : string
Parameters
$data
array
The data to be used in the creation of the pie chart
Returns
string
The SVG markup for the described pie chart
Create a scatter graph using the data provided and return the SVG markup
create_scatter_graph(array $data, string $x_label = 'X Axis'
, string $y_label = 'Y Axis'
, string $x_units = ''
, string $y_units = ''
) : string
Parameters
$data
array
The data to be used in the creation of the scatter graph
$x_label
string
The X axis label
$y_label
string
The Y axis label
$x_units
string
The X axis units label
$y_units
string
The Y axis units label
Returns
string
The SVG markup for the described scatter graph
Constants
BAR_WIDTH
BAR_WIDTH = 15.0
BOX_SPACING
BOX_SPACING = 5.0
CROSS_SIZE
CROSS_SIZE = 8.0
MIN_X_MARKER_DISTANCE
MIN_X_MARKER_DISTANCE = 14.0
MIN_Y_MARKER_DISTANCE
MIN_Y_MARKER_DISTANCE = 14.0
PIE_RADIUS
PIE_RADIUS = 190
PLOT_HEIGHT
PLOT_HEIGHT = SVG_HEIGHT - X_LABEL_HEIGHT - X_AXIS_HEIGHT - PLOT_HEIGHT_BIAS
PLOT_HEIGHT_BIAS
PLOT_HEIGHT_BIAS = 10.0
PLOT_WIDTH
PLOT_WIDTH = SVG_WIDTH - Y_LABEL_WIDTH - Y_AXIS_WIDTH - PLOT_WIDTH_BIAS
PLOT_WIDTH_BIAS
PLOT_WIDTH_BIAS = 10.0
SVG_HEIGHT
SVG_HEIGHT = 400.0
SVG_WIDTH
SVG_WIDTH = 1024.0
TEXT_HEIGHT
TEXT_HEIGHT = 14.0
VIEWPORT_HEIGHT
VIEWPORT_HEIGHT = 400.0
VIEWPORT_WIDTH
VIEWPORT_WIDTH = 1024.0
X_AXIS_HEIGHT
X_AXIS_HEIGHT = 13.0
X_LABEL_HEIGHT
X_LABEL_HEIGHT = 13.0
X_PADDING
X_PADDING = 2.0
Y_AXIS_WIDTH
Y_AXIS_WIDTH = 50.0
Y_LABEL_WIDTH
Y_LABEL_WIDTH = 50.0
Y_PADDING
Y_PADDING = 2.0