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

When creating the chart for the second time, patterns don't appear (pattern-fill.js 7.1.3+) #12053

Closed
raf18seb opened this issue Sep 24, 2019 · 6 comments · Fixed by #12577
Closed

Comments

@raf18seb
Copy link
Contributor

raf18seb commented Sep 24, 2019

When the chart is created for the first time, everything works fine.

Actual behaviour

Since 7.1.3, when we create the chart again, pattern fill is not applied.

Live demo with steps to reproduce

https://jsfiddle.net/BlackLabel/mq4Ltkvd

Product version

Highcharts 7.1.3+
Works fine in 7.1.2

@TorsteinHonsi
Copy link
Collaborator

@oysteinmoseng Can you explain the change you did with the chart index? Is this a bug?

@oysteinmoseng
Copy link
Member

Ah, well this is a scenario we didn't anticipate. The issue was that we got pushback from customers on having duplicate IDs on a page, so the chart index is added to the IDs for the default patterns. We kept the original IDs for the first chart in order to preserve backwards compatibility. And as a quirk, it is perfectly possible to refer to patterns in previous charts, meaning the original IDs will work for all charts. Unless of course you destroy that chart, which is what is happening here.

We might have to introduce an adapter layer between the IDs referenced and the actual IDs in order to solve this properly. That way we could have a mapping between unique IDs and the way to reference them in options.

@MagneH
Copy link

MagneH commented Nov 27, 2019

Any movement on this issue? This happens for me when using the fill in a treemap built in React. When i change the data of the treemap and rerender the component, the treemap is created/rendered without the fill.
@oysteinmoseng

@oysteinmoseng
Copy link
Member

@MagneH Will look at this in depth this week and see if we can add a fix

@MagneH
Copy link

MagneH commented Dec 2, 2019

Sounds good! :D

@oysteinmoseng
Copy link
Member

@MagneH A quick head's up that it looks like our fix will break backwards compatibility for default patterns: #12577 (comment)

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

Successfully merging a pull request may close this issue.

5 participants