Widget:WJG Sandbox: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1,029: | Line 1,029: | ||
datas += percent + "%<br /><br />Click the Navigation Buttons on the left to review the questions you answered.<br /><br />"; | datas += percent + "%<br /><br />Click the Navigation Buttons on the left to review the questions you answered.<br /><br />"; | ||
datas += "<canvas id=' | datas += "<canvas id='simExams' width='600' height='400'></canvas>"; | ||
$("#examSpace").append(datas); | $("#examSpace").append(datas); | ||
Line 1,055: | Line 1,055: | ||
var | var simExamData = { | ||
labels : point_labels, | labels : point_labels, | ||
datasets : [ | datasets : [ | ||
Line 1,064: | Line 1,064: | ||
pointStrokeColor : "#fff", | pointStrokeColor : "#fff", | ||
data : qdist, | data : qdist, | ||
title: " | title: "Percent of test takers" | ||
} | } | ||
] | ] | ||
Line 1,071: | Line 1,071: | ||
var newopts = { | var newopts = { | ||
yAxisLabel : "Percent | yAxisLabel : "Percent of test takers", | ||
yAxisFontFamily : "'Arial'", | yAxisFontFamily : "'Arial'", | ||
yAxisFontSize : 16, | yAxisFontSize : 16, | ||
Line 1,077: | Line 1,077: | ||
yAxisFontColor : "#666", | yAxisFontColor : "#666", | ||
legend : | legend : false, | ||
legendFontFamily : "'Arial'", | legendFontFamily : "'Arial'", | ||
legendFontSize : 12, | legendFontSize : 12, | ||
Line 1,087: | Line 1,087: | ||
graphTitle : " | graphTitle : "Peer Performance", | ||
graphTitleFontFamily : "'Arial'", | graphTitleFontFamily : "'Arial'", | ||
graphTitleFontSize : 24, | graphTitleFontSize : 24, | ||
Line 1,095: | Line 1,095: | ||
// get line chart canvas | // get line chart canvas | ||
var | var simExams = document.getElementById('simExams').getContext('2d'); | ||
// draw line chart | // draw line chart | ||
new Chart( | new Chart(simExams).Line(simExamData,newopts); | ||