Prevent plotting of the chart in case there is no data

This fix complements the fix for gortsilas:permission-json-fix (permission error response as json for ajax calls)