This button must be programmed to read a file in Excel with two columns, the first with data (x) and the second with data (y). the new records must be graphed but I have not yet achieved it.
var lineChartData = {
"datasets": [{
"data": [
"85",
"87",
"70",
"80",
"78",
"100",],
"pointStrokeColor": "#1A81C5",
"fillColor": "rgba(254, 254, 254, 0.4)",
"pointColor": "#1A81C5",
"strokeColor": "#5D9CC6"
}],
"labels": [
"10",
"20",
"30",
"40",
"50",
"60"],
};
var options = {showTooltips: true};
Chart.types.Line.extend({
name: "LineAlt",
highlightPoints: function(datasetIndex, pointIndexArray){
var activePoints = [];
var points = this.datasets[datasetIndex].points;
for(i in pointIndexArray){
if(points[pointIndexArray[i]]){
activePoints.push(points[pointIndexArray[i]]);
}
}
this.showTooltip(activePoints);
}
});
var myLine = new Chart(document.getElementById("canvas").getContext("2d")).LineAlt(lineChartData, options);
var highlight = function(index){
myLine.highlightPoints(0, [index]);
}
$("#slider").slider({
max: lineChartData.datasets[0].data.length-1,
slide: function( event, ui ) { highlight(ui.value); },
});
The contents of the Excel file when read with the code I add in my question is as follows: