Tuesday, July 29, 2014

Re: I don't understand whats wrong with the way im passing django list to json

fixed it i was passing strings and not integers

<script src="{% static 'js/chart.js' %}"></script>
<script>
var randomScalingFactor = function(){ return Math.round(Math.random()*100)};
var lineChartData = {
labels : ["1000","2000","3000","4000","5000","6000","7000", "8000", "9000", "10000", "11000", "12000", "13000", "14000", "15000",],
datasets : [
{
label: "CPU Usage in MHZ",
fillColor : "rgba(220,220,220,0.2)",
strokeColor : "rgba(220,220,220,1)",
pointColor : "rgba(220,220,220,1)",
pointStrokeColor : "#fff",
pointHighlightFill : "#fff",
pointHighlightStroke : "rgba(220,220,220,1)",
data : {{cpu_values}}
}
]

}

window.onload = function(){
var ctx = document.getElementById("canvas").getContext("2d");
window.myLine = new Chart(ctx).Line(lineChartData, {
responsive: true
});
}

</script>

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1b6ea547-7c07-469b-921c-f089b3e7c7d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment