Merge pull request #22449 from mattwire/phpnotices
[civicrm-core.git] / templates / CRM / common / chart.tpl
index 30fdd5532aeb27049deb172f0ebfc4c2d9bcd8a1..730dc273430d8c599722efc83e5b81f3200246a4 100644 (file)
@@ -46,7 +46,7 @@ function createChart( chartID, divName, xSize, ySize, data ) {
   links.style.marginBottom = '1rem';
   var linkSVG = document.createElement('a');
   linkSVG.href = '#';
-  linkSVG.textContent = 'Download chart (SVG)';
+  linkSVG.textContent = '{/literal}{ts escape="js"}Download chart (SVG){/ts}{literal}';
   linkSVG.addEventListener('click', e => {
     e.preventDefault();
     e.stopPropagation();
@@ -68,7 +68,7 @@ function createChart( chartID, divName, xSize, ySize, data ) {
   }
   var linkPNG = document.createElement('a');
   linkPNG.href = '#';
-  linkPNG.textContent = 'Download chart (PNG)';
+  linkPNG.textContent = '{/literal}{ts escape="js"}Download chart (PNG){/ts}{literal}';
   linkPNG.addEventListener('click', e => {
     e.preventDefault();
     e.stopPropagation();
@@ -138,14 +138,11 @@ function createChart( chartID, divName, xSize, ySize, data ) {
       .turnOnControls(true)
       .renderTitle(true);
   }
-  // Delay rendering so that animation looks good.
-  window.setTimeout(() => {
-    div.appendChild(heading);
-    div.appendChild(chartNode);
-    div.appendChild(links);
+  div.appendChild(heading);
+  div.appendChild(chartNode);
+  div.appendChild(links);
 
-    dc.renderAll();
-  }, 1500);
+  dc.renderAll();
 }
 </script>
 {/literal}