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
package stats

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

stringThe 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
package stats

Parameters

$data

array

The data to be used in the creation of the pie chart

Returns

stringThe 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
package stats

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

stringThe SVG markup for the described scatter graph

Constants

 

BAR_WIDTH

BAR_WIDTH = 15.0 
package stats
 

BOX_SIZE

BOX_SIZE = 10.0 
package stats
 

BOX_SPACING

BOX_SPACING = 5.0 
package stats
 

CROSS_SIZE

CROSS_SIZE = 8.0 
package stats
 

MIN_X_MARKER_DISTANCE

MIN_X_MARKER_DISTANCE = 14.0 
package stats
 

MIN_Y_MARKER_DISTANCE

MIN_Y_MARKER_DISTANCE = 14.0 
package stats
 

PIE_RADIUS

PIE_RADIUS = 190 
package stats
 

PLOT_HEIGHT

PLOT_HEIGHT = SVG_HEIGHT - X_LABEL_HEIGHT - X_AXIS_HEIGHT - PLOT_HEIGHT_BIAS 
package stats
 

PLOT_HEIGHT_BIAS

PLOT_HEIGHT_BIAS = 10.0 
package stats
 

PLOT_WIDTH

PLOT_WIDTH = SVG_WIDTH - Y_LABEL_WIDTH - Y_AXIS_WIDTH - PLOT_WIDTH_BIAS 
package stats
 

PLOT_WIDTH_BIAS

PLOT_WIDTH_BIAS = 10.0 
package stats
 

SVG_HEIGHT

SVG_HEIGHT = 400.0 
package stats
 

SVG_WIDTH

SVG_WIDTH = 1024.0 
package stats
 

TEXT_HEIGHT

TEXT_HEIGHT = 14.0 
package stats
 

VIEWPORT_HEIGHT

VIEWPORT_HEIGHT = 400.0 
package stats
 

VIEWPORT_WIDTH

VIEWPORT_WIDTH = 1024.0 
package stats
 

X_AXIS_HEIGHT

X_AXIS_HEIGHT = 13.0 
package stats
 

X_LABEL_HEIGHT

X_LABEL_HEIGHT = 13.0 
package stats
 

X_PADDING

X_PADDING = 2.0 
package stats
 

Y_AXIS_WIDTH

Y_AXIS_WIDTH = 50.0 
package stats
 

Y_LABEL_WIDTH

Y_LABEL_WIDTH = 50.0 
package stats
 

Y_PADDING

Y_PADDING = 2.0 
package stats