-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Pie Chart - The chart does not display the original size after exiting full screen mode #13222
Comments
FYI @raf18seb |
Thanks for reporting @madepiet Workaround: Maybe we could write the logic that would remember the original height and restore it after exiting from the fullscreen. @sebastianbochan what do you think? |
As a wrokaround you can set width/height in CSS styles. (Works only with values in px, not percents). Demo: @raf18seb its good idea and I think that is not also very complicated solution. However we need to verify if (after exit of fullscreen) |
Hi, we're seeing this in our usage of lines charts and it's actually happening in the demo below on We can't set width/height to be static because the chart needs to be responsive with in it's container. Browser & Operating System |
can some body provide inputs on this ? |
@v-abkhot |
this is no working that only i have reported |
because the issue is not about the container height it is about svg. height |
Please share your live demo i.e reproduced by jsfiddle.net |
i have already share screen shot of it what is happening after adding fix width to that container |
i have identified the issue... there is issue with svg height |
and this need to be fixed. |
so can some body actually look into this ? |
Hi @v-abkhot, ps. please use edit instead of sending so many short messages. |
https://codepen.io/v-abkhot/pen/vYNQxQg?editors=1100 in this second graph when you open in full screen and exit to normal it is modified size |
i am using react wrapper |
Hi @v-abkhot,
|
@raf18seb you work around is not working for hichart- react |
Hi @v-abkhot, could you provide a simplified online demo of your chart so I can debug it? The one you provided: https://codepen.io/v-abkhot/pen/vYNQxQg?editors=1100 is just a demo with 2 charts. You set the height on the first container, but not for the second one - that's why workaround is not working for the second chart. Please, try to set #container, #container1 {
height: 400px;
} |
Hi @raf18seb i have added to code pen in that for direct highchart if we set height then it is working fine but if we use it in hichart-react-officials as above screen shot issue with the svg height |
Hi @raf18seb can you please try this same with hichart-react-officials |
(function(H) {
var addEvent = H.addEvent,
isMS = H.isMS,
wrap = H.wrap;
H.Fullscreen.prototype.open = function() {
var fullscreen = this,
chart = fullscreen.chart,
originalHeight = chart.chartHeight;
chart.setSize(void 0, screen.height, false);
fullscreen.originalHeight = originalHeight;
// Handle exitFullscreen() method when user clicks 'Escape' button.
if (fullscreen.browserProps) {
fullscreen.unbindFullscreenEvent = addEvent(chart.container.ownerDocument, // chart's document
fullscreen.browserProps.fullscreenChange,
function() {
// Handle lack of async of browser's fullScreenChange event.
if (fullscreen.isOpen) {
fullscreen.isOpen = false;
fullscreen.close();
chart.setSize(void 0, originalHeight, false);
} else {
fullscreen.isOpen = true;
fullscreen.setButtonText();
}
});
var promise = chart.renderTo[fullscreen.browserProps.requestFullscreen]();
if (promise) {
// No dot notation because of IE8 compatibility
promise['catch'](function() {
alert( // eslint-disable-line no-alert
'Full screen is not supported inside a frame.');
});
}
addEvent(chart, 'destroy', fullscreen.unbindFullscreenEvent);
}
};
wrap(H.Fullscreen.prototype, 'close', function(proceed) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
var fullscreen = this;
fullscreen.chart.setSize(void 0, fullscreen.originalHeight, false);
});
})(Highcharts) |
hi @raf18seb, how can I use this script in react? |
@haor3 - right after importing Highcharts: import Highcharts from 'highcharts';
(function(H) {
...
})(Highcharts); |
@pawelfus thanks but the issue still occurs |
@haor3 could you provide more info? What exactly is not working for you? Could you provide an online demo showing your case so we can take a closer look at it? Thanks! |
@raf18seb thanks for your example, works for me! i did some changes, mostly add this:
because i have problems with mouse position after enter in fullscreen mode.
|
And one more thing i want to tell about - workaround for scatter plot mouse positioning problems in fullscreen mode. I thought that I fixed this problem with:
But I found out, that this solution not working for a scatter plot.
|
Still open issue, when fixed by highcharts we could simply update the version, more info on highcharts/highcharts#13222
I used the code from @siropkin comment. It worked partially. I have
|
Are we going to have an official fix for this? It's very odd that fullscreen is allowed to be in a state like this. |
Hi @Blackbaud-TylerGreen Thank you for contacting us. I have marked the issue with the |
But using this snippet when you click full-screen view. It only displays a chart on the half screen. |
To test a fix before it gets merged into the master branch you could use the commit hash like in this demo: |
Sorry to comment here if not appropriate. I notice this was fixed 2 days ago and I'm having the same problem right now using the React package. Is this pushed to the latest npm package yet? |
@stroypet no, it will probably be a few weeks until the next release. |
Actual behaviour
The initial demo version of the pie chart is displayed as with the given sizes.
After running "View full screen" / "Exit full screen" note that the size of the chart changes (it has been reduced or increased).
The problem occurs in the official Highcharts demo:
https://www.highcharts.com/demo/pie-basic
As well as in the editor with a simplified code:
https://jsfiddle.net/BlackLabel/weo19uvy/
Product version
Highcharts v8.0.4
Affected browser(s)
Chrome 80.0.3987.149
The text was updated successfully, but these errors were encountered: