First - a compliment for a great module!

When trying to override chart properties by using the provided Highcharts starterkit, all works well, until you want to override properties for the x and y axes.
For example, this statement in the class ChartsOverridesHighcharts, function chartOverrides works.
$options['plotOptions']['series']['dataLabels']['enabled'] = true;

If you try to override a property in one of the chart axes, the chart will not render at all.
$options['yAxis']['tickInterval'] = 0; // Remove the Y axis line completely.

The reason for this is the naming of the functions, e.g. "setAxisY", which conflicts with the options format expected by Highcharts - "yAxis". Further, yAxis is array keyed by the axis number and xAxis is an object (single axis).

CommentFileSizeAuthor
#2 Highcharts_override_axes-3049960-1.patch1.67 KBjordik

Comments

JordiK created an issue. See original summary.

jordik’s picture

StatusFileSize
new1.67 KB

Patch provided - please test.

jordik’s picture

Status: Active » Needs review
jordik’s picture

Issue summary: View changes

  • andileco committed c7560f6 on 8.x-3.x authored by JordiK
    Issue #3049960 by JordiK: Impossible to override axes using Highcharts
    
andileco’s picture

Status: Needs review » Needs work

I implemented a patch to provide some documentation, but ultimately the module will need a patch similar to yours. I tested it, but it wasn't quite working. Your code, $options['yAxis']['tickInterval'] = 0; works with the patch, but this (below) doesn't work with your current patch:

    $options['yAxis'] = [
        [
          'title' => [
            'text' => 'My Overridden Chart Title 2',
          ],
          'labels' => [
              'overflow' => 'justify',
              'suffix' => '',
              'prefix' => '',
          ],
          'stackLabels' => [
            'enabled' => TRUE,
          ],
          'plotBands' => NULL,
          'min' => NULL,
          'max' => NULL,
        ]
      ];
bluegeek9’s picture

Assigned: jordik » Unassigned
Status: Needs work » Fixed

8.x-3.x is bug fixes only. We encourage everyone to migrate to 5.1.x.

//www.flaticon.com/free-icons/thank-you Thank you for your contribution! Your continued support of this project makes other volunteer contributions more sustainable.
There are multiple ways to show appreciation for the work contributed to this project, including:
  • Triaging issues and adding more context to existing issues.
  • Writing documentation or patches for this project.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.