Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- createLineChart: function (id, history, min, max) {
- var ctx = document.querySelector('#' + id).getContext("2d");
- for (var i = 0; i < history.length; i++) {
- history[i] = Math.round(history[i] * 100) / 100;
- }
- var lineChartData = {
- labels: ['', '', '', '', ''],
- datasets: [
- {
- label: id,
- fillColor: "rgba(56,142,60,0.4)",
- strokeColor: "rgba(56,142,60,1)",
- pointColor: "rgba(56,142,60,1)",
- pointStrokeColor: "#fff",
- pointHighlightFill: "#fff",
- pointHighlightStroke: "rgba(56,142,60,1)",
- data: history
- },
- {
- //an empty dataset to trigger custom tooltips
- }
- ]
- };
- var c = new Chart(ctx).Line(lineChartData, {
- responsive: true
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement