Re: bar charts

2011-11-08 Thread Venkatraman S
I have documented a set of viz libraries:
http://blizzardzblogs.blogspot.com/2010/12/data-visualization-charts-and.html

-V-

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-08 Thread kenneth gonsalves
On Tue, 2011-11-08 at 21:16 +1100, Mario Gudelj wrote:
> I'm a Django/Python beginner, but the above works for me and it plots
> the number of items per month, where the Y-axis is the number of items
> and X-axis is the month names.

I found it faster and more efficient to generate the DataTable using
google's gviz_api
-- 
regards
Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-08 Thread Mario Gudelj
Hey, I implemented a line chart and this is my code:

View:

def render_chart(request):
months =
['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
month_values = [0,0,0,0,0,0,0,0,0,0,0,0]
list_of_items = MyModel.objects.all()
for item in list_of_items:
if item.creation_date.strftime("%b") ==
months[item.creation_date.month - 1]:
month_values[item.creation_date.month - 1] =
month_values[item.creation_date.month - 1] + 1

d = {'user':request.user, 'months':months, 'month_values':month_values}
return render_to_response('chart.html', d)

And this is the template:

script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Month');
data.addColumn('number', 'bookings');
data.addRows(12);
{% for month in months %}

data.setValue({{forloop.counter0}}, 0, '{{month}}');
{% for value in month_values %}
data.setValue({{forloop.counter0}}, 1, {{value}});
{%endfor%}
{%endfor%}
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, {width: 760, height: 380, title: 'Stats'});
  }
 wrote:

>  On 2011年11月07日 21:26, Andre Terra wrote:
>
> Pass serialized json as a template variable?
>
> yes of course, pupulate data from django is not special, it's a normal
> process just like other language. we can output json to the chart
>
>
> That's what I'm doing atm. But JKM has built an app to help reduce the
> need to write javascript [1]. I haven't used it myself, but it looks
> interesting and promising.
>
>
> Cheers,
> AT
>
> [1] https://github.com/jacobian/django-googlecharts
>
>
> On Mon, Nov 7, 2011 at 8:16 AM, kenneth gonsalves 
> wrote:
>
>> On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote:
>> > Here's the Quick Start page: http://goo.gl/g5I7X
>>
>>  that is easy - how does one populate with data from django?
>>  --
>> regards
>> Kenneth Gonsalves
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread skysb...@gmail.com

On 2011?11?07? 21:26, Andre Terra wrote:

Pass serialized json as a template variable?
yes of course, pupulate data from django is not special, it's a normal 
process just like other language. we can output json to the chart


That's what I'm doing atm. But JKM has built an app to help reduce the 
need to write javascript [1]. I haven't used it myself, but it looks 
interesting and promising.



Cheers,
AT

[1] https://github.com/jacobian/django-googlecharts


On Mon, Nov 7, 2011 at 8:16 AM, kenneth gonsalves 
> wrote:


On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote:
> Here's the Quick Start page: http://goo.gl/g5I7X

that is easy - how does one populate with data from django?
--
regards
Kenneth Gonsalves

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com
.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google 
Groups "Django users" group.

To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread kenneth gonsalves
On Mon, 2011-11-07 at 11:26 -0200, Andre Terra wrote:
> Pass serialized json as a template variable?
> 
> 

got it to work. I had passed the json, but had to turn autoescape off to
get it to work.
-- 
regards
Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread bax...@gretschpages.com
Most times I just use css and percentwidth for simple bar charts.

On Nov 7, 10:23 am, Leotis buchanan <leotisbucha...@exterbox.com>
wrote:
> You could also try processing.js
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread Leotis buchanan
You could also try processing.js


Regards
Leotis Buchanan
Co-Founder
Exterbox




On Mon, Nov 7, 2011 at 9:22 AM, Yok Keen Hui  wrote:

> You could try out cairoplot, it works for me in Django, just have to print
> the render as a picture to a url and reference it from there(looks nice
> too!)
>
>
> On Tue, Nov 8, 2011 at 12:26 AM, Andre Terra  wrote:
>
>> Pass serialized json as a template variable?
>>
>> That's what I'm doing atm. But JKM has built an app to help reduce the
>> need to write javascript [1]. I haven't used it myself, but it looks
>> interesting and promising.
>>
>>
>> Cheers,
>> AT
>>
>> [1] https://github.com/jacobian/django-googlecharts
>>
>>
>>
>> On Mon, Nov 7, 2011 at 8:16 AM, kenneth gonsalves > > wrote:
>>
>>> On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote:
>>> > Here's the Quick Start page: http://goo.gl/g5I7X
>>>
>>> that is easy - how does one populate with data from django?
>>> --
>>> regards
>>> Kenneth Gonsalves
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Django users" group.
>>> To post to this group, send email to django-users@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread Brad Montgomery
+1 for Google Charts.


For small stuff (1 chart), I just render JavaScript in the  of my 
html templates. For more complex stuff, you could write a view that *just* 
renders JavaScript and include it via a script tag. Just make sure to serve 
it with MIME type "application/javascript"


Here's more info on generating Non-HTML content:
http://djangobook.com/en/2.0/chapter13/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/M_rJLephha4J.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread Yok Keen Hui
You could try out cairoplot, it works for me in Django, just have to print
the render as a picture to a url and reference it from there(looks nice
too!)

On Tue, Nov 8, 2011 at 12:26 AM, Andre Terra  wrote:

> Pass serialized json as a template variable?
>
> That's what I'm doing atm. But JKM has built an app to help reduce the
> need to write javascript [1]. I haven't used it myself, but it looks
> interesting and promising.
>
>
> Cheers,
> AT
>
> [1] https://github.com/jacobian/django-googlecharts
>
>
>
> On Mon, Nov 7, 2011 at 8:16 AM, kenneth gonsalves 
> wrote:
>
>> On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote:
>> > Here's the Quick Start page: http://goo.gl/g5I7X
>>
>> that is easy - how does one populate with data from django?
>> --
>> regards
>> Kenneth Gonsalves
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread Andre Terra
Pass serialized json as a template variable?

That's what I'm doing atm. But JKM has built an app to help reduce the need
to write javascript [1]. I haven't used it myself, but it looks interesting
and promising.


Cheers,
AT

[1] https://github.com/jacobian/django-googlecharts


On Mon, Nov 7, 2011 at 8:16 AM, kenneth gonsalves wrote:

> On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote:
> > Here's the Quick Start page: http://goo.gl/g5I7X
>
> that is easy - how does one populate with data from django?
> --
> regards
> Kenneth Gonsalves
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread Tim Sawyer
Flot.

http://code.google.com/p/flot/

My docs about what I did:
http://drumcoder.co.uk/tags/flot/

Example (including zooming by slider):
http://brassbandresults.co.uk/bands/rothwell-temperance-band/

Enjoy,

Tim.

> hi,
>
> what do people use to display bar charts in their sites?
> --
> regards
> Kenneth Gonsalves
>
> --
> regards
> Kenneth Gonsalves
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread kenneth gonsalves
On Mon, 2011-11-07 at 19:36 +0800, skysb...@gmail.com wrote:
> On 2011年11月07日 18:16, kenneth gonsalves wrote:
> > On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote:
> >> Here's the Quick Start page: http://goo.gl/g5I7X
> > that is easy - how does one populate with data from django?
> do you know how to populate with data with other develop language??
> 

no - I was looking at gviz_api, which I got to work in python, but not
with django.

-- 
regards
Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread skysb...@gmail.com

On 2011年11月07日 18:16, kenneth gonsalves wrote:

On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote:

Here's the Quick Start page: http://goo.gl/g5I7X

that is easy - how does one populate with data from django?

do you know how to populate with data with other develop language??

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread kenneth gonsalves
On Mon, 2011-11-07 at 04:28 -0500, Joey Espinosa wrote:
> Here's the Quick Start page: http://goo.gl/g5I7X

that is easy - how does one populate with data from django?
-- 
regards
Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread Joey Espinosa
Kenneth,

It's a Google API. Like other Google tools, you can connect using
google.load() within JavaScript code. It wouldn't integrate directly with
Django, but rather through your templates by using JavaScript.
--
Joey "JoeLinux" Espinosa*
*





On Mon, Nov 7, 2011 at 2:39 AM, kenneth gonsalves wrote:

> On Mon, 2011-11-07 at 00:04 -0500, Kevin Anthony wrote:
> > Google charts api
> >
> >
>
> any clues on how to integrate this with django?
> --
> regards
> Kenneth Gonsalves
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-07 Thread skysb...@gmail.com

On 2011年11月07日 12:57, kenneth gonsalves wrote:

hi,

what do people use to display bar charts in their sites?

a lot choices, like html5 chart, flash chart.

amchart,zingchart, i'm trying to use zingchart in my site now, it 
provide both flash and html5 solution.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-06 Thread kenneth gonsalves
On Mon, 2011-11-07 at 00:04 -0500, Kevin Anthony wrote:
> Google charts api
> 
> 

any clues on how to integrate this with django?
-- 
regards
Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: bar charts

2011-11-06 Thread Kevin Anthony
Google charts api

Kevin
Please excuse brevity, sent from phone
On Nov 6, 2011 11:57 PM, "kenneth gonsalves" <law...@thenilgiris.com> wrote:

> hi,
>
> what do people use to display bar charts in their sites?
> --
> regards
> Kenneth Gonsalves
>
> --
> regards
> Kenneth Gonsalves
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



bar charts

2011-11-06 Thread kenneth gonsalves
hi,

what do people use to display bar charts in their sites?
-- 
regards
Kenneth Gonsalves

-- 
regards
Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.