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

MACD unable to remove when no plot #8848

Closed
KacperMadej opened this issue Aug 28, 2018 · 1 comment
Closed

MACD unable to remove when no plot #8848

KacperMadej opened this issue Aug 28, 2018 · 1 comment

Comments

@KacperMadej
Copy link

Behaviour

No plot due to not enough data in base series. On the MACD remove - error.
this.graphmacd = this.graphmacd.destroy();

Live demo with steps to reproduce

http://jsfiddle.net/BlackLabel/5gsmy12w/1/

Steps:

  1. click destroy
  2. error in browser console

Internal note: Might be related to #8847

@pawelfus
Copy link
Contributor

Workaround:
Overwrite destroy() for MACD, demo: http://jsfiddle.net/BlackLabel/u128rx05/

Snippet:

(function(H) {
  H.seriesTypes.macd.prototype.destroy = function() {
    // this.graph is null due to removing two times the same SVG element
    this.graph = null;
    this.graphmacd = this.graphmacd && this.graphmacd.destroy();
    this.graphsignal = this.graphsignal && this.graphsignal.destroy();

    H.seriesTypes.sma.prototype.destroy.apply(this, arguments);
  };
})(Highcharts);

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

No branches or pull requests

2 participants