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

Treemap: Inconsistent data label behavior #4751

Closed
andrei-picus-hs opened this Issue Nov 18, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@andrei-picus-hs

andrei-picus-hs commented Nov 18, 2015

Data labels are rendered inconsistently between resizing a treemap and rendering it fresh.

treemap

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Dec 14, 2015

Contributor

Could you setup jsFiddle demo with that issue? We will check this.

Contributor

pawelfus commented Dec 14, 2015

Could you setup jsFiddle demo with that issue? We will check this.

@andrei-picus-hs

This comment has been minimized.

Show comment
Hide comment
@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Dec 15, 2015

Contributor

Thanks!

Internal note:
Compare: http://jsfiddle.net/sz0esszz/2/ (after click) vs http://jsfiddle.net/sz0esszz/3/ - both examples get the same width (470px), but the first one is missing labels.

Contributor

pawelfus commented Dec 15, 2015

Thanks!

Internal note:
Compare: http://jsfiddle.net/sz0esszz/2/ (after click) vs http://jsfiddle.net/sz0esszz/3/ - both examples get the same width (470px), but the first one is missing labels.

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Apr 4, 2016

Collaborator

This issue will be fixed in the upcoming maintenance release. For those in need of a workaround take a look below.

Workaround
Open the treemap.src.js source file in a text editor. Locate the drawDataLabels function around line 612. Find and replace the following code snippet:

// replace this
if (point.shapeArgs) {
    options.style.width = point.shapeArgs.width;
}

// with this
if (point.shapeArgs) {
    options.style.width = point.shapeArgs.width;
    if (point.dataLabel) {
        point.dataLabel.css({ width: point.shapeArgs.width + 'px' });
    }
}
Collaborator

jon-a-nygaard commented Apr 4, 2016

This issue will be fixed in the upcoming maintenance release. For those in need of a workaround take a look below.

Workaround
Open the treemap.src.js source file in a text editor. Locate the drawDataLabels function around line 612. Find and replace the following code snippet:

// replace this
if (point.shapeArgs) {
    options.style.width = point.shapeArgs.width;
}

// with this
if (point.shapeArgs) {
    options.style.width = point.shapeArgs.width;
    if (point.dataLabel) {
        point.dataLabel.css({ width: point.shapeArgs.width + 'px' });
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment