function QuantChartChartAPI::chart_count in Quant 7
Fill a count-type chart with data
1 call to QuantChartChartAPI::chart_count()
- QuantChartChartAPI::build in plugins/
QuantChartChartAPI.inc - Implements parent::build().
File
- plugins/
QuantChartChartAPI.inc, line 259
Class
- QuantChartChartAPI
- QuantChart plugin class to generate charts using chart.module (Chart API)
Code
function chart_count() {
$max = 0;
// Determine the highest available value on y-axis
foreach ($this->quant->data->data as $key => $value) {
$this->chart['#data'][] = $value;
// If pie chart, let's add the numeric value to the label
if ($this->quant->chartType == 'pie') {
$this
->x_label($key . ' (' . $value . ')');
}
else {
$this
->x_label($key);
}
$max = max($max, $value);
}
$this
->y_range(0, $max);
}