Skip to content
Snippets Groups Projects
Commit bd1e43b0 authored by andileco's avatar andileco
Browse files

Fix broken fields in the Chart Attachment display and code formatting edits.

parent 67f9ef5a
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,7 @@
* Implements hook_requirements().
*/
function charts_requirements($phase) {
$requirements = array();
$requirements = [];
return $requirements;
}
......@@ -3,4 +3,3 @@ access all charts:
title: 'Administer Charts'
description: 'This permission needs to be fleshed out.'
restrict access: TRUE
......@@ -20,11 +20,11 @@ class ChartsApiExample extends ControllerBase implements ContainerInjectionInter
$library = $this->chartSettings['library'];
$options = [];
$options['type'] = $this->chartSettings['type'];
$options['title'] = t('Chart title');
$options['yaxis_title'] = t('Y-Axis');
$options['title'] = $this->t('Chart title');
$options['yaxis_title'] = $this->t('Y-Axis');
$options['yaxis_min'] = '';
$options['yaxis_max'] = '';
$options['xaxis_title'] = t('X-Axis');
$options['xaxis_title'] = $this->t('X-Axis');
//sample data format
$categories = ["Category 1", "Category 2", "Category 3", "Category 4"];
$seriesData = [
......
......@@ -32,7 +32,6 @@ class ModuleSelector {
private function moduleExists($moduleName, &$variables) {
$moduleExist = \Drupal::moduleHandler()->moduleExists($moduleName);
if ('charts_' . $moduleExist) {
$className = ucfirst($moduleName);
$moduleChartsRenderer = 'Drupal\charts_' . $moduleName . '\Charts\\' . ucfirst($moduleName) . 'ChartsRender';
$chartingModule = new $moduleChartsRenderer();
$chartingModule->charts_render_charts($this->options, $this->categories, $this->seriesData, $this->attachmentDisplayOptions, $variables, $this->chartId);
......
......@@ -142,7 +142,7 @@ class ChartsConfigForm extends ConfigFormBase {
}
}
if (count($library_options) == 0) {
drupal_set_message(t('There are no enabled charting libraries. Please enable a Charts sub-module.'));
drupal_set_message($this->t('There are no enabled charting libraries. Please enable a Charts sub-module.'));
}
$form['library'] = [
'#title' => $this->t('Charting library'),
......
......@@ -80,11 +80,8 @@ class ChartsPluginDisplayChart extends Attachment {
'value' => $this->getOption('inherit_yaxis') ? t('Use primary Y-axis') : t('Create secondary axis'),
];
$options['attachment_position'] = ['disabled' => TRUE];
$options['inherit_pager'] = ['disabled' => TRUE];
$options['render_pager'] = ['disabled' => TRUE];
unset($options['attachment_position']);
unset($options['inherit_pager']);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment