Chart.js Testing
HTML
<script src="http://zphyr.org/test/js/ui/Chart.js"></script>
<div id = "insertElement"></div>
CSS
div#insertElement {
width: 500px;
border: 1px solid #ccc;
height: 300px;
}
JavaScript
console.clear();
$(function() {
var parentElement = $("#insertElement"),
chartElement = document.createElement("canvas");
$(chartElement)
.attr("width", parentElement.width())
.attr("height", parentElement.height());
parentElement.append(chartElement);
var chartInstance =
new Chart(
chartElement.getContext('2d')
).Line(
{
labels : [1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1],
datasets : [
{
fillColor : "rgba(220,220,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
data : [1, 0, 1, 0, 1, 3, 0, 2, 1, 5, 0, 5, 4, 2, 0, 2, 1]
}
]
},
{
bezierCurve : false
}
);
});