FVANCOP / ChartNew.js

MIT License
420 stars 142 forks source link

Chart rendering Bug when Popup is forced in new Tab #397

Closed flash-me closed 8 years ago

flash-me commented 8 years ago

Hello,

We have a Popup (window.open..) where the Chart is placed. Our issue is, that if a user forced the internet Explorer >= 10 to open new popup as new tabs, the chart will not be rendered until changing to another tab and back.

If the popup opens in a new window, everything seems to work.

These are the options:

this._chart = new Chart(ctx).Line(lineChartData, { showTooltips: false, showXLabels:1, rotateLabels: 0, scaleFontSize: 11, animation: !this._isIE, yAxisLabel: "foo", xAxisLabel: "foo", graphMin: 0, fmtYLabel: "Numbers" });

chart not rendering

markosko commented 8 years ago

Hello, what about adding this as parameter to options> dynamicDisplay : false

this._chart = new Chart(ctx).Line(lineChartData, {
showTooltips: false,
showXLabels:1,
rotateLabels: 0,
scaleFontSize: 11,
animation: !this._isIE,
yAxisLabel: "foo",
xAxisLabel: "foo",
graphMin: 0,
dynamicDisplay : false,
fmtYLabel: "Numbers"
});

but I think dynamicDisplay is by default false

flash-me commented 8 years ago

Thank you for your reply, but it does not work. The chart will not be rendered until i switch to another tab and back in IE >= 10

FVANCOP commented 8 years ago

This problem is related to the way the browser works - You will have the same problem with Chart.js.

I have defined a new option : animationForceSetTimeOut; Use the last published version of ChartNew.js, set the option "animationForceSetTimeOut : true" and try if it solves the problem for IE. It is a bypass for the problem, not really a solution....

I could reproduce a similar problem in Firefox; Apparently, in Firefox, HTML/Javacrips in other tabs runs but much slower than in displayed tab. For Firefox, the animationForceSetTimeOut will not solve the problem... and I have no solution for it....

Perhaps, is issue #244 similar to this (I've never treated issue 244).

flash-me commented 8 years ago

Hello,

I'm a bit late. But I got the new version and tried it with the new option. And it works!

Thank you very much for your quick response!

Best regards

vqanguyen commented 8 years ago

Hello, i have the same problem. I tested in Google Chrome. I have a main page A (with many displaying graphs built by ChartNew.js), page A having a button for downloading a pdf file. When we click to download pdf, open pdf in chrome, zoom ++/-- pdf, back to page A, the chart will not be rendered until changing to another tab and back. If we open pdf in a new window, everything seems to work. By setting animationForceSetTimeOut : true", it's better, after downloading pdf, the graph disappears and returns in 1 second.