Created
September 28, 2018 19:54
-
-
Save andregardi/7dbe750e15d6232791f43eb93a185c52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function renderChart(data, labels) { | |
var ctx = document.getElementById("myChart").getContext('2d'); | |
var myChart = new Chart(ctx, { | |
type: 'line', | |
data: { | |
labels: labels, | |
datasets: [{ | |
label: 'This week', | |
data: data, | |
}] | |
}, | |
}); | |
} | |
$("#renderBtn").click( | |
function () { | |
data = [20000, 14000, 12000, 15000, 18000, 19000, 22000]; | |
labels = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"]; | |
renderChart(data, labels); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment