Hide Charts when there is no data.



  • Hi All,
    Can you please help me to understand how to dynamically hide charts when there is no data related to that chart using jsreport. Thank You in advance.



  • Which recipe do you use?

    I believe you should write a custom helper like:

    function shouldPrintChart(items) {
      return items.length > 0
    }
    

    and then use it around the chart declaration

    {{#shouldPrintChart myItems}}
    ...chart
    {{/shouldPrintChart }}
    


  • I am using xlsx recipe. Sorry for replying late. Will try this and come back to you. Thank you


Log in to reply
 

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.