Function __global->graph_line_chart

Definitions

sources/graphs.php

  • Generate a line chart.Multiple measures across one even dimension (x) and one uneven dimension (y).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$datasets array No No required parameter N/A N/A Data-sets to render
$x_labels ?array No No Null N/A N/A Labels for X-axis (null: numeric sequence for each data point, based on first set of data points)
$x_axis_label mixed No No Blank (empty string) N/A N/A X-axis label, provided in plain-text format (string or Tempcode)
$y_axis_label mixed No No Blank (empty string) N/A N/A Y-axis label, provided in plain-text format (string or Tempcode)
$options array No No [] N/A N/A Map of additional fiddly options
$color_pool ?array No No [] N/A N/A Colour pool to use (null: default colour pool)
$width ?string No No Null N/A N/A Width (null: responsive)
$height ?string No No Null N/A N/A Height (null: responsive)

Returns

  • The chart
  • Type: Tempcode
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Generate a line chart.Multiple measures across one even dimension (x) and one uneven dimension (y).
 *
 * @param  array $datasets Data-sets to render
 * @param  ?array $x_labels Labels for X-axis (null: numeric sequence for each data point, based on first set of data points)
 * @param  mixed $x_axis_label X-axis label, provided in plain-text format (string or Tempcode)
 * @param  mixed $y_axis_label Y-axis label, provided in plain-text format (string or Tempcode)
 * @param  array $options Map of additional fiddly options
 * @param  ?array $color_pool Colour pool to use (null: default colour pool)
 * @param  ?string $width Width (null: responsive)
 * @param  ?string $height Height (null: responsive)
 * @return Tempcode The chart
 */

function graph_line_chart(array $datasets, ?array $x_labels = null, $x_axis_label = '', $y_axis_label = '', array $options = [], ?array $color_pool = [], ?string $width = null, ?string $height = null) : object