You are here

public function ChartData::getInfo in Charts 5.0.x

Same name and namespace in other branches
  1. 8.4 src/Element/ChartData.php \Drupal\charts\Element\ChartData::getInfo()

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides ElementInterface::getInfo

File

src/Element/ChartData.php, line 17

Class

ChartData
Provides a chart data render element.

Namespace

Drupal\charts\Element

Code

public function getInfo() {
  return [
    '#title' => NULL,
    '#labels' => NULL,
    '#data' => [],
    '#color' => NULL,
    '#show_in_legend' => TRUE,
    // Show inline labels next to the data.
    '#show_labels' => FALSE,
    // If building multicharts. The chart type, e.g. pie.
    '#chart_type' => NULL,
    // Line chart only.
    '#line_width' => 1,
    // Line chart only. Size in pixels, e.g. 1, 5.
    '#marker_radius' => 3,
    // If using multiple axes, key for the matching y axis.
    '#target_axis' => NULL,
    // Formatting options.
    // The number of digits after the decimal separator. e.g. 2.
    '#decimal_count' => NULL,
    // A custom date format, e.g. %Y-%m-%d.
    '#date_format' => NULL,
    '#prefix' => NULL,
    '#suffix' => NULL,
  ];
}