Gast
#4217085
Hallo ich mache gerade erste Gehversuche mit HTML und co
ich würde gerne eine CSV in ein Array of Objekt wandeln-->
function loadCSV(){
var myArray = [];
var FILE_NAME = html "movies.csv";
// declare all our variables at the top
var bigString, lines, tempArray, tempObject,
bigString = FILE_NAME
// array.split() string on carriage return to create an
array of records
lines = bigString.split("\n");
// loop through records and split each on commas
lines.forEach(function(line){
tempArray = line.split(",");
tempObject = {};
tempObject.title = tempArray[0];
tempObject.rating = tempArray[1];
tempObject.link = tempArray[2];
myArray.push(tempObject);
});
}
und mit
myLineChart.drawLine(myArray, "red", 1);
an die nächste Funktion übergeben. Diese myLineChart.drawLine()
funktioniert mit einem dummy schon mal so wie sie soll
zb --->
var data = [{
x: 0,
y: 80
}, {
x: 2,
y: 75
}, {....
Kann mir da bitte wer weiter helfen
Gruß