Entrypoint Error rendering visual. Entrypoint afterDraw for the code to dispaly extra heading for the visual

Hi @shaun,

I m using the below code to show the heading text to denote the emoji’s of the visual. Though it loads the text and the visual, I still get the Entrypoint error. Can you please suggest me why it is happening ?

Note: Error doesn’t occur all the times.

return {
version: “1”,

disableDraw: function() { return false },

beforeDraw: function () {},

afterDraw: function() {
if (arcapi.dataResult().rows().length === 0) {
return;
}

const visualID = arcapi.chartId();
const widgetID = visualID.replace("a","title");

document.getElementById(widgetID).innerHTML += 
  "<span style='margin-left:33%'> 👍 - High, 👎 - Low, 👉 -  Medium  </span><br>  <div  style='margin-left:41%'> Trend based on last 30 days</div>";

}
};

@Chaish can you share the error you’re seeing? Also what version of Arcadia are you using currently?

@taddwood Please find the below error

  • Visual 521 - Error rendering visual 521. Extension 15. Entrypoint afterDraw

TypeError: Cannot read property ‘innerHTML’ of nullTypeError: Cannot read property ‘innerHTML’ of null at Object.afterDraw (eval at j.processJs, :18:14) at Array.forEach ()

@Chaish it would appear that you’re not handling the case when innerHTML isn’t set or perhaps the widget structure is empty. This isn’t fatal, but you could try to clean-up the code to avoid this error if its becoming bothersome.