O3PO_Plotter
in package
Collection of functions for visualization of data by means of relatively simple html.
Provides in particular a function to plot histograms.
Tags
Table of Contents
Properties
- $caption_refs : mixed
- Array of tags of referencable captions.
- $last_num : mixed
- Array of the most recent referencable caption by caption type.
Methods
- caption() : string
- Plot caption
- histogram() : string
- Histogram
Properties
$caption_refs
Array of tags of referencable captions.
private
mixed
$caption_refs
Tags
$last_num
Array of the most recent referencable caption by caption type.
private
mixed
$last_num
Tags
Methods
caption()
Plot caption
public
caption(mixed $type, mixed $text[, mixed $ref = null ]) : string
Returns HTML code suitable for captions of plots produced with this class.
Parameters
- $type : mixed
- $text : mixed
- $ref : mixed = null
Tags
Return values
string —HTML code of the caption
histogram()
Histogram
public
histogram(array<string|int, mixed> $data, float $x_delta, int $max_x_labels, int $max_y_labels, string $max_width, string $height[, string $x_label = null ][, string $y_label = null ][, string $color = "#000000" ][, string $caption = null ][, string $ref = null ]) : string
Display the provided data as a histogram.
Parameters
- $data : array<string|int, mixed>
-
Array of data to be displayed as a histogram. Can be a dictionary, in which case the values will be interpreted as the data.
- $x_delta : float
-
The width of the bins (in x direction) of the histogram.
- $max_x_labels : int
-
The maximum number of labels on the x axis.
- $max_y_labels : int
-
The maximum number of labels on the y axis.
- $max_width : string
-
HTML length for the maximum width, below that takes 100% of the available space
- $height : string
-
HTML length for the height of the plot
- $x_label : string = null
-
The label of the x axis
- $y_label : string = null
-
The label of the y axis
- $color : string = "#000000"
-
The color of of the bars in HTML notation (defaults to '#000000').
- $caption : string = null
-
The caption of the plot (optional)
- $ref : string = null
-
The reference key of this plot
Tags
Return values
string —The generated html code of the histogram