score:0

Accepted answer

in generatedatasetsfromtable(), move your dataset creation outside of the tr loop (rows.each)

function generatedatasetsfromtable()
{
    var data;
    var datasets = [];
    var rows = jquery("tr");
    var data = [];
    rows.each(function(index){
        if (index != 0) // we dont need first row of table
        {
           var cols = $(this).find("td");  
            cols.each(function(innerindex){
                if (innerindex!=0) // we dont need first columns of the row                 
                      data.push($(this).text()); 
            }); 
        }
    });

    var dataset = 
        {
            fillcolor: "rgba(238,155,0,0.2)",
            strokecolor: "rgba(217,0,0,1)",
            pointcolor: "rgba(166,0,0,1)",
            pointstrokecolor: "#fff",
            pointhighlightfill: "#fff",
            pointhighlightstroke: "rgba(151,187,205,1)",
            data : data
        }
    datasets.push(dataset);
    return datasets;
}

fiddle - http://jsfiddle.net/fv3ry41s/


Related Query

More Query from same tag