make the d3.js chart dynamic, work in progress