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

plotLine labels do not work in browsers that support Array.prototype.flat() #8477

Closed
cers opened this issue Jun 14, 2018 · 6 comments
Closed

plotLine labels do not work in browsers that support Array.prototype.flat() #8477

cers opened this issue Jun 14, 2018 · 6 comments
Labels

Comments

@cers
Copy link

@cers cers commented Jun 14, 2018

The issue comes from line

I'm not sure what that "if" is testing for, but that attribute will probably have to be renamed...

Expected behaviour

plotLine labels should show up.

Actual behaviour

plotLine labels do not show up.

Live demo with steps to reproduce

http://jsfiddle.net/cers/whzeL2um/

Product version

Highcharts 6.1.0 (I haven't checked the others)

Affected browser(s)

Firefox 62
Chrome 69

@sebastianbochan
Copy link
Contributor

@sebastianbochan sebastianbochan commented Jun 14, 2018

Hi @cers,
Thank you for the reporting.

Internal note
The issue is more complex and i.e appears also in other references i.e:

@cfarm
Copy link

@cfarm cfarm commented Sep 18, 2018

Can confirm this is also an issue in version 5.0.11 in Chrome 69.

@sebastianbochan
Copy link
Contributor

@sebastianbochan sebastianbochan commented Sep 19, 2018

Hi @cfarm,
The issue has been already fixed, so I advise you to update your Highcharts library to the newest version (v6.1.3).

@TorsteinHonsi
Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi commented Sep 25, 2018

Workaround

Here's a workaround for those who can't update Highcharts for some reason:

    // Drop-in fix for Highcharts issue #8477 on older Highcharts versions. The
    // issue is fixed since Highcharts v6.1.1.
    Highcharts.wrap(Highcharts.Axis.prototype, 'getPlotLinePath', function(proceed) {
        var path = proceed.apply(this, Array.prototype.slice.call(arguments, 1));
        if (path) {
            path.flat = false;
        }
        return path;
    });

View it live on jsFiddle.

@eltonjude
Copy link

@eltonjude eltonjude commented Sep 25, 2018

I required a null check for path in our application.

@TorsteinHonsi
Copy link
Collaborator

@TorsteinHonsi TorsteinHonsi commented Sep 26, 2018

Thanks, I added an if to the snippet above.

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

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.