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

Offline PDF Exporting Shows Invisible Series #7090

Closed
samirelanduk opened this Issue Aug 22, 2017 · 3 comments

Comments

Projects
None yet
3 participants
@samirelanduk

samirelanduk commented Aug 22, 2017

Expected behaviour

When exporting the chart to a file, the generated image should reflect that chart as it appears on screen at the time it was produced. Specifically, only visible series should be present in the image.

Actual behaviour

PNG and SVG output behave as expected, but PDF export shows all series, including those invisible at time of file generation.

Live demo with steps to reproduce

https://codepen.io/samirelanduk/pen/rzvqON

Download files for PNG and PDF in the above demo and you'll see what I mean.

Affected browser(s)

Chrome 60
(haven't tried others)

@KacperMadej

This comment has been minimized.

Show comment
Hide comment
@KacperMadej

KacperMadej Aug 22, 2017

Contributor

Hi,

Thank you for reporting about the problem.
Minimal demo: http://jsfiddle.net/u5m3bfat/

Contributor

KacperMadej commented Aug 22, 2017

Hi,

Thank you for reporting about the problem.
Minimal demo: http://jsfiddle.net/u5m3bfat/

@KacperMadej KacperMadej added the Bug label Aug 22, 2017

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Aug 23, 2017

Collaborator

Workaround

Remove all hidden nodes before converting to PDF:

Highcharts.wrap(Highcharts.Chart.prototype, 'getChartHTML', function (proceed) {
    proceed.call(this);
    this.container.querySelectorAll('*[visibility="hidden"]').forEach(function (node) {
    	node.remove();
    });
    return this.container.innerHTML;
});

View it live on jsFiddle.

Collaborator

TorsteinHonsi commented Aug 23, 2017

Workaround

Remove all hidden nodes before converting to PDF:

Highcharts.wrap(Highcharts.Chart.prototype, 'getChartHTML', function (proceed) {
    proceed.call(this);
    this.container.querySelectorAll('*[visibility="hidden"]').forEach(function (node) {
    	node.remove();
    });
    return this.container.innerHTML;
});

View it live on jsFiddle.

@TorsteinHonsi

This comment has been minimized.

Show comment
Hide comment
@TorsteinHonsi

TorsteinHonsi Aug 23, 2017

Collaborator

Related issue in svg2pdf: yWorks/svg2pdf.js#28

Collaborator

TorsteinHonsi commented Aug 23, 2017

Related issue in svg2pdf: yWorks/svg2pdf.js#28

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