This is an example of a line graph with multiple lines and labels at the end of those lines.
Created in responce to a question on d3noob.org
A few points to note:
-
The csv file starts with the newest data point and ends with the oldest. If you needed to get the 'y' position of the last point in the array you will need to use
data[data.length-1].open
rather thandata[0].open
. -
I've left some console.log calls in the code as small demos.
-
The script makes the adjustment for scale using the
y
function.
forked from d3noob's block: Multiple line graphs with labels