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

2014-07-29 Thread Tom Evans
On Tue, Jul 29, 2014 at 12:10 AM, G Z wrote: > so I'm trying to display some vm performance data on javascript charts. It > needs the information as a list, I have tried passing a json list from > django and a django list like below in the javascript i ahve the one they > tell me to use and the on

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

2014-07-29 Thread G Z
> > 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 b

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

2014-07-29 Thread G Z
fixed it i was passing strings and not integers var randomScalingFactor = function(){ return Math.round(Math.random()*100)}; var lineChartData = { labels : ["1000","2000","3000","4000","5000","6000","7000", "8000", "9000", "1", "11000", "12000", "13000", "14000", "15000",], datasets : [ { l

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

2014-07-29 Thread G Z
["2014-07-28 14:24:11", "2014-07-28 14:24:11"] On Monday, July 28, 2014 5:10:50 PM UTC-6, G Z wrote: > > so I'm trying to display some vm performance data on javascript charts. It > needs the information as a list, I have tried passing a json list from > django and a django list like below in th

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

2014-07-29 Thread G Z
the values will show how, but i ran into another problem while trying to input the labels, labels need to be strings so I input them as an array such as the following: ["2014-07-28 14:24:11", "2014-07-28 14:24:11"] I saved it as a simple json in django and pass it to the webbrowser and then con

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

2014-07-29 Thread G Z
solved date_values= json.dumps(list(date_values), cls=DjangoJSONEncoder) var date_values = {{ date_values|safe }}; var lineChartData = { labels : date_values, datasets : [ { label: "CPU Usage in MHZ", fillColor : "rgba(220,220,220,0.2)", strokeColor : "rgba(220,220,220,1)", pointColor : "rgba(220