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

Inactive tooltip overlays charts in page longer than 9999px #3532

Closed
KacperMadej opened this issue Oct 22, 2014 · 6 comments
Closed

Inactive tooltip overlays charts in page longer than 9999px #3532

KacperMadej opened this issue Oct 22, 2014 · 6 comments
Assignees

Comments

@KacperMadej
Copy link

When page is longer than 9999px then empty tooltip boxes start appearing on the page. It appears their position is translated to (0,-9999) so when a page extends longer they are no longer hidden from view.

Example: http://jsfiddle.net/meku/5vvdwL20/

The empty white tooltip squares actually belong to the charts near the bottom of the page.

@pawelfus
Copy link
Contributor

Connected to #3542

Workaround: http://jsfiddle.net/5vvdwL20/3/

Snippet:

(function (H, HA) {
    H.wrap(H.Tooltip.prototype, 'init', function (p, c, o) {
        p.call(this, c, o);
        this.label.hide();
    });


    H.wrap(H.SVGElement.prototype, 'hide', function (p, inherit) {
        if (this.div) {
            HA.animate(this.div, {
                opacity: 1
            }, {
                duration: 0   
            });
        }
        return p.call(this, inherit);
    });


    H.wrap(H.SVGElement.prototype, 'show', function (p, inherit) {
        if (this.div) {
            HA.animate(this.div, {
                opacity: 1
            }, {
                duration: 1   
            });
        }
        return p.call(this, inherit);
    });

    H.wrap(H.SVGElement.prototype, 'fadeOut', function (p, duration) {
        var elemWrapper = this;
        elemWrapper.animate({
            opacity: 0
        }, {
            duration: H.pick(duration, 150),
            complete: function () {
                elemWrapper.hide(); // #3088, assuming we're only using this for tooltips
            }
        });
        if (elemWrapper.div) {
            HA.animate(elemWrapper.div, {
                opacity: 0
            }, {
                duration: H.pick(duration, 150)
            });
        }
    });
})(Highcharts, HighchartsAdapter)

@TorsteinHonsi
Copy link
Collaborator

Can't we just du this the brute-force way and set tooltip y to -99999 instead of -9999?

@pawelfus
Copy link
Contributor

Is there sam limitation in SVG for y position? If not, why not use -Number.MAX_VALUE ?

@TorsteinHonsi
Copy link
Collaborator

It's probably okay. You can test it in different browsers and see.

@pawelfus pawelfus self-assigned this Sep 29, 2015
@pawelfus pawelfus assigned KacperMadej and unassigned pawelfus Nov 16, 2015
@DavidKDeutsch
Copy link

DavidKDeutsch commented Jul 12, 2016

I see this issue was never closed; has the fix not made it into an official release yet?

Also, I see many other instances of -9999 (and +9999) in the version of the code I have (2.1.10); are there plans to make those other instance +/-9e9 as well?

@TorsteinHonsi
Copy link
Collaborator

Fixed by c97123f, badly named

TorsteinHonsi added a commit that referenced this issue Oct 6, 2016
… This prevents the empty label from being present in exported SVG.

Touches #2301, #2657, #3532, #5570.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants