ChartData.php in Charts 5.0.x
Same filename and directory in other branches
Namespace
Drupal\charts\ElementFile
src/Element/ChartData.phpView source
<?php
namespace Drupal\charts\Element;
use Drupal\Core\Render\Element\RenderElement;
/**
* Provides a chart data render element.
*
* @RenderElement("chart_data")
*/
class ChartData extends RenderElement {
/**
* {@inheritdoc}
*/
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,
];
}
}