No data in chart change the message

Hello Team Helical,
I am using Helical Insight 3.1 Enterprise edition. There are certain instances when there is no data. However it still plots the chart but without any data shown like below.

Please help me with the same.

Thank You
Goboja

1 Like

Hello Goboja,

In the JS editor of the report which you are creating please add the below code.

var id = hi_container.get("renderId");
var chartId = '#main';
if(id != ''){
chartId = chartId+'-'+id;
}
hi_container.set("postExecution",function(c){
var d = c.get("responseData")
if(d.data.length == 0){
$(chartId).html("<div style='font-size:20px; text-align: center; font-weight: bold'>No Data Available</div>")
}
else{
console.log("not empty")
}
});

You can add more HTML, CSS, etc for changing and customizing this message.

NOTE: If you are using “cache refresh” script then this above script migt not work. As soon as the cache refresh will happen and the page refresh will happen it will revert to the older one. So in those cases please download the cache refresh script from CacheRefresh.zip (1.9 KB) (unzip it) and place it in the location “C:\Program Files\Helical Insight\hi\hi-repository\System\Admin\CustomScripts\generic\js”. No restart is required. Try in private window and if you have already applied cache refresh script somewhere then remove it and apply agian.

Thank you
Team Helical