Commit 12cf47d6 authored by Lauris's avatar Lauris

fix: throw errors instead of alerts

parent 08d18940
......@@ -991,8 +991,7 @@
// check "x" is defined if timeseries
if (isTimeSeries && xs.length === 0) {
window.alert('data.x or data.xs must be specified when axis.x.type == "timeseries"');
return [];
throw new Error('data.x or data.xs must be specified when axis.x.type == "timeseries"');
}
// save x for update data by load
......@@ -1880,8 +1879,7 @@
selectChart = d3.select(__bindto);
if (selectChart.empty()) {
window.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');
return;
throw new Error('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');
} else {
selectChart.html("");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment