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

Spreadsheet chart thinks it's in styled mode when it isn't #7113

Open
WoozyG opened this issue Feb 13, 2025 · 0 comments
Open

Spreadsheet chart thinks it's in styled mode when it isn't #7113

WoozyG opened this issue Feb 13, 2025 · 0 comments

Comments

@WoozyG
Copy link
Contributor

WoozyG commented Feb 13, 2025

Description

We enabled the Highcharts export menu. When a user selects the "Print" option, Vaadin/Highcharts hides everything but that chart and then triggers browser print.

The Vaadin code in vaadin-chart-mixin.js among other actions adds a style class to the body element if this.chart.styledMode is true. However, I can see from the debugger that my Flow code is properly sending false for that attribute in the JSON for the chart. Somehow the mixin is still seeing true and setting the body style, which then breaks our chart representation, and the print preview is wrong.

That code was from the admittedly "quick and dirty" fix way back for #389. As Highcharts has been updated to a newer major version since then, that issue may no longer exist and that fix may not be needed.

The only place I can see so far that might be related is line 323 in the mixin, the constructor method. That sets the flag to true. The Flow config class defaults to Boolean.FALSE so that's a mismatch, but I still don't see how it could end up true when I'm passing false from the Flow side.

Haven't got a sample project working yet.

Expected outcome

Chart printing should look just like chart display. Body CSS classes should not change.

Minimal reproducible example

working on it, hitting some sort of browser issue thinking the ChartObject isn't defined.

Steps to reproduce

Enable the offline-export Highcharts module
style a chart with attributes, not CSS
try printing the chart, and notice some attributes are overridden by styling.

Our example uses vertical grid lines on the x axis. Vaadin has a CSS class that only applies when the styled classname is applied that hides those. When printing, that style becomes active and overrides our grid line definition.

Environment

Vaadin version(s): 24.6.5
OS: N/A

Browsers

No response

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

No branches or pull requests

2 participants