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='buyers' width='600' height='400'></canvas>";
datas += "<canvas id='simExams' width='600' height='400'></canvas>";
$("#examSpace").append(datas);
$("#examSpace").append(datas);


Line 1,055: Line 1,055:




var buyerData = {
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: "Individual tests"
title: "Percent of test takers"
}
}
             ]
             ]
Line 1,071: Line 1,071:


var newopts = {
var newopts = {
yAxisLabel : "Percent Correct",
yAxisLabel : "Percent of test takers",
yAxisFontFamily : "'Arial'",
yAxisFontFamily : "'Arial'",
yAxisFontSize : 16,
yAxisFontSize : 16,
Line 1,077: Line 1,077:
yAxisFontColor : "#666",
yAxisFontColor : "#666",


legend : true,
legend : false,
legendFontFamily : "'Arial'",
legendFontFamily : "'Arial'",
legendFontSize : 12,
legendFontSize : 12,
Line 1,087: Line 1,087:




graphTitle : "My Performance",
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 buyers = document.getElementById('buyers').getContext('2d');
             var simExams = document.getElementById('simExams').getContext('2d');
             // draw line chart
             // draw line chart
             new Chart(buyers).Line(buyerData,newopts);
             new Chart(simExams).Line(simExamData,newopts);





Revision as of 00:18, 23 May 2014