Commit 74d2c2a9 authored by Masayuki Tanaka's avatar Masayuki Tanaka

Add check if 'bindto' element exists

parent 0c942577
...@@ -834,7 +834,7 @@ ...@@ -834,7 +834,7 @@
/*-- Draw Chart --*/ /*-- Draw Chart --*/
// for svg elements // for svg elements
var svg, defs, main, context, legend, tooltip; var svg, defs, main, context, legend, tooltip, selectChart;
// for brush area culculation // for brush area culculation
var firstDate = null, lastDate = null, orgXDomain; var firstDate = null, lastDate = null, orgXDomain;
...@@ -844,6 +844,12 @@ ...@@ -844,6 +844,12 @@
var grid, xgridLine; var grid, xgridLine;
var i; var i;
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;
}
// TODO: set names if names not specified // TODO: set names if names not specified
// Init sizes and scales // Init sizes and scales
......
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