Closed lgrijsen closed 9 years ago
Hey, @lgrijsen - great question! You could use client.run(query, callback)
and build the viz manually if you like:
var chart = new Keen.Dataviz()
.chartType("barchart")
.height(400)
.prepare(); // start spinner
client.run(query, function(err, res){
if (err) {
chart.error(err.message);
}
else if (!res.result.length) {
chart.error("No results to visualize");
}
else {
chart
.parseRequest(this)
.title("Visualizing " + res.result.length + " results");
.render();
}
});
I succesfully get results from Keen.Query, but in some circumstances with a certain set of filters, there are no results from the database (which is correct), but how to prevent drawing (client.draw) in that case?
There is a textual message ('No results to visualize'), but how to alter that, or better, to prevent?