Force highchart redraws on first page change

Resolves #1

Change-Id: Id67de92d0634f017dc411c51eb2245eeafa554c7
diff --git a/inst/rmarkdown/templates/revealjs_presentation/resources/default.html b/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
index 297df7f..f23dbe1 100644
--- a/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
+++ b/inst/rmarkdown/templates/revealjs_presentation/resources/default.html
@@ -686,11 +686,19 @@
         makeFooterVisible();
       }
     }
-
     Reveal.on('ready', event => {
       makeFooterAndSlideNumberInvisibleOnTitlePage(event);
     });
+
+    hcChartsInitialized = false;
     Reveal.addEventListener('slidechanged', (event) => {
+      if(!hcChartsInitialized) {
+        Highcharts.charts.forEach((chart) => {
+        if(chart != null) {
+          chart.setSize(chart.chartWidth + 1, chart.chartHeight)
+        }});
+        hcChartsInitialized = true;
+      }
       makeFooterAndSlideNumberInvisibleOnTitlePage(event);
     });
 </script>