protected function getValuesFromDataTable($dataTable)
{
$columns = $this->config->columns_to_display;
$columnToPlot = false;
if (!empty($columns)) {
$columnToPlot = reset($columns);
if ($columnToPlot == 'label') {
$columnToPlot = next($columns);
}
}
// a Set is returned when using the normal code path to request data from Archives, in all core plugins
// however plugins can also return simple datatable, hence why the sparkline can accept both data types
if ($this->dataTable instanceof DataTable\Map) {
$values = $this->getValuesFromDataTableMap($dataTable, $columnToPlot);
} elseif ($this->dataTable instanceof DataTable) {
$values = $this->dataTable->getColumn($columnToPlot);
} else {
$values = false;
}
return $values;
}