Commit 12cf47d6 authored by Lauris's avatar Lauris

fix: throw errors instead of alerts

parent 08d18940
...@@ -991,8 +991,7 @@ ...@@ -991,8 +991,7 @@
// check "x" is defined if timeseries // check "x" is defined if timeseries
if (isTimeSeries && xs.length === 0) { if (isTimeSeries && xs.length === 0) {
window.alert('data.x or data.xs must be specified when axis.x.type == "timeseries"'); throw new Error('data.x or data.xs must be specified when axis.x.type == "timeseries"');
return [];
} }
// save x for update data by load // save x for update data by load
...@@ -1880,8 +1879,7 @@ ...@@ -1880,8 +1879,7 @@
selectChart = d3.select(__bindto); selectChart = d3.select(__bindto);
if (selectChart.empty()) { if (selectChart.empty()) {
window.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".'); throw new Error('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');
return;
} else { } else {
selectChart.html(""); 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