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

this.options.dataLabels.style.textOverflow is not checking this.options.dataLables.style != undefined #8666

Closed
dangsd opened this issue Jul 23, 2018 · 4 comments

Comments

@dangsd
Copy link

@dangsd dangsd commented Jul 23, 2018

Expected behaviour

chart displays correctly

Actual behaviour

crashes the site with

TypeError: Cannot read property 'textOverflow' of undefined
    at e.<anonymous> (highstock.js:368)
    at Array.forEach (<anonymous>)
    at a.each (highstock.js:28)
    at e.A.pie.A.pie.placeDataLabels (highstock.js:368)
    at e.A.pie.A.pie.drawDataLabels (highstock.js:366)
    at e.render (highstock.js:303)
    at e.<anonymous> (highstock.js:522)
    at e.a.(:8080/anonymous function) [as render] (http://localhost:8080/build/app.bundle.js:1174:80)
    at highstock.js:255
    at Array.forEach (<anonymous>)

Live demo with steps to reproduce

It is hard to reproduce

Product version

highcharts 6.1.1
@types/highcharts 5.0.25

Affected browser(s)

chrome 67.0.3396.99

@sebastianbochan
Copy link
Contributor

@sebastianbochan sebastianbochan commented Jul 24, 2018

Hi @dangsd,
Could you send us a chart's config and data?

@brimimc
Copy link

@brimimc brimimc commented Aug 3, 2018

Here is an example where it fails https://jsfiddle.net/avL0hum7/1/

@brimimc
Copy link

@brimimc brimimc commented Aug 3, 2018

@dangsd I found a work-around in the meantime - in my case I'm in a Pie Chart, so set

            plotOptions: {
                pie: {
                    dataLabels: {
                        style: {
                            textOverflow: 'ellipsis',
                        }
                    }
                }
            }

@sebastianbochan
Copy link
Contributor

@sebastianbochan sebastianbochan commented Aug 3, 2018

Hi @brimimc,
Thank you for demo.

Internal note
The problem appears only in the styled mode since 6.1.0 version (6.0.7 works properly - https://jsfiddle.net/BlackLabel/57rxh892/).

Non styled: https://jsfiddle.net/BlackLabel/zgq8316s/ works properly.

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
3 participants