Chartnew.js cannot show chart after durandal project published

👍:0

One possible explanation is the slight server side delay introduced by your debug=true delays the chart initialization just enough so that the canvas element has non-zero size when new Chart... is called.

One easy way to confirm if this is the case is to ensure that your canvas HTML is always visible (i.e. take off any code that dynamically hides it / shows it…) and see if the issue occurs.

You need to ensure that the canvas element is visible when the Chart data is loaded i.e. new Chart... is called.

I think resizeGraph and / or chartJsResize (for ChartNew.js) could also be used to force a redraw (say, with a setTimeout with enough delay to ensure that the canvas element has been rendered)

Leave a comment