Tom, I have done alot actually,
I have put the data into a json array, a list, a tupple, a dictionary. I have tried the following:
my data has been passed in every possible way I can think of. What I need to know how to do is convert a python list I pass with django to a javascript list because I believe that will correct the problem. Yes you are correct if I look at the second one [1,2,3,45,5] is how the data is ordered ie it is a list, however my data passes exactly the same.
<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 : [{{Json_data}}]
data : {{json_data}}
data : {{tupple_array}}
data : {{ list }}
data : [ {{tupple_data }} ]
data : [ {{ list }} ]
}
]
}
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/c6d25ead-ce53-4cb9-8371-e12d2ad2c47e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment