Accepted answer

The way you are referencing your object's properties doesn't work in javascript.

You assign:

var xColumn = "date";
var yColumn = "high";

and then try to reference and d.high with:

 .x(function (d) { return xScale(d.xColumn); })
 .y(function (d) { return yScale(d.yColumn); });

d.yColumn and d.xColumn will return undefined. If you want to reference them this way you need to use notation like: d[xColumn] and d[yColumn].

Related Query

More Query from same tag