One option could be to use csv()
from the D3.js library
Lets say you have that data in a data.csv
that looks something like this:
"year","rate"
1952-53,3.00
1953-54,3.00
1954-55,3.50
First create a function to map the CSV column data to an array:
function makeChart(sampledata) {
var sampledataLabels = sampledata.map(function(d) {
return d.year;
});
var weeksData = sampledata.map(function(d) {
return +d.rate;
});
var chart = new Chart('chart', {
type: "line",
data: {
labels: sampledataLabels,
datasets: [
{
data: weeksData
}
]
}
});
}
Then read it in via d3.csv()
d3.csv('so_chart.csv')
.then(makeChart);
I got most of this code from this excellent blog post from createwithdata.com