Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polar axis ignores custom default options #16112

Closed
OldBuddy opened this issue Jul 28, 2021 · 1 comment · Fixed by #16113
Closed

Polar axis ignores custom default options #16112

OldBuddy opened this issue Jul 28, 2021 · 1 comment · Fixed by #16113

Comments

@OldBuddy
Copy link

Expected behaviour

Polar axis should respect options set with 'Highcharts.setOptions' in case when 'yAxis' definition is array.

Actual behaviour

Default options for yAxis are ignored.

Live demo with steps to reproduce

https://jsfiddle.net/nc9ruy3x/

Product version

Latest

Affected browser(s)

All

@raf18seb
Copy link
Contributor

Hi @OldBuddy, thanks for reporting a bug.

Related to #1053 (was fixed for a normal axis, but not for the radial axis)

Demo with a workaround: https://jsfiddle.net/BlackLabel/hkd97xL2/

(function(H) {
  var fireEvent = H.fireEvent,
    merge = H.merge,
    defaultOptions = H.defaultOptions,
    registerEventOptions = H._modules['Core/Foundation.js'].registerEventOptions;

  H.addEvent(H.Axis, 'init', function() {
    if (this.isRadial) {
      this.setOptions = function(userOptions) {
        var options = this.options = merge(this.constructor.defaultOptions,
          this.defaultPolarOptions,
          userOptions, merge(
            // if set in setOptions (#1053):
            defaultOptions[this.coll], userOptions));
        // Make sure the plotBands array is instanciated for each Axis
        // (#2649)
        if (!options.plotBands) {
          options.plotBands = [];
        }
        fireEvent(this, 'afterSetOptions');
      };
    }
  });
})(Highcharts)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants