Is it possible to show 'no data available' inside dygraph chart when the response contains empty array
You can do this :http://jsfiddle.net/60ygwkgk/26/
Code
data = ",\n0,0";
g = new Dygraph(
document.getElementById("graph"),
data,{
drawYAxis:false,
title:'no data available',
pointSize: 0,
highlightCircleSize: 0,
showLabelsOnHighlight:false
} );
Thanks @loli, your solution was very useful for me. In my case:
if (contentcsv.length<1) { //if contentcsv is empty
contentcsv = ",\n0,0";
var title = "no data available";
}
else {title = "My Title";}
g = new Dygraph(
document.getElementById("graph"),
contentcsv,
{
title: title,
ylabel: 'Values',
xlabel: 'Date',
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With