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

Exported to SVG charts can have the same id for clipPath and a wrong clipPath is used #5926

Closed
KacperMadej opened this Issue Nov 3, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@KacperMadej
Contributor

KacperMadej commented Nov 3, 2016

Behaviour

When exporting charts to SVG and then placing those SVGs into a site clipPath id is duplicated.
IE11 and Firefox are using the first clipPath and second chart is wrongly clipped.

Live demo with steps to reproduce

https://jsfiddle.net/8rkkqmLf/
The two charts are exported to SVG from a simple demo with just changed height.

Affected browser(s)

IE11, Firefox

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Nov 7, 2016

Collaborator

@TorsteinHonsi Is it possible for the svg to look within itself for the clipPath, in other words have a more specific rule to identify the clipPath?

Collaborator

jon-a-nygaard commented Nov 7, 2016

@TorsteinHonsi Is it possible for the svg to look within itself for the clipPath, in other words have a more specific rule to identify the clipPath?

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Nov 7, 2016

Collaborator

The Highcharts object keeps track of the id's, so there will never be two items with the same id in the same page. This is handled through the Highcharts.idCounter, and definitions will have id's like highcharts-0, highcharts-1 etc.

This system breaks if someone exports a chart from different pages and pastes the SVG into the same page. To prevent this situation we would have to extend the simple counter with a random hash that is (likely) unique to the Highcharts object on the page. Then everywere we run idCounter++ we should instead return a slightly more complicated id, like highcharts-oiwjd-0.

Collaborator

TorsteinHonsi commented Nov 7, 2016

The Highcharts object keeps track of the id's, so there will never be two items with the same id in the same page. This is handled through the Highcharts.idCounter, and definitions will have id's like highcharts-0, highcharts-1 etc.

This system breaks if someone exports a chart from different pages and pastes the SVG into the same page. To prevent this situation we would have to extend the simple counter with a random hash that is (likely) unique to the Highcharts object on the page. Then everywere we run idCounter++ we should instead return a slightly more complicated id, like highcharts-oiwjd-0.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Nov 7, 2016

Collaborator

PS: No tests added, the auto-visual tests will reveal regressions.

Collaborator

TorsteinHonsi commented Nov 7, 2016

PS: No tests added, the auto-visual tests will reveal regressions.

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