preliminary code from d3js.org for a line chart