Re: [web2py] Graphs

2012-08-15 Thread FERNANDO VILLARROEL
Thank you everyone for you help.
Where i can see some how to for i can use d3 visualizations fed from web2py or 
Charts?
Regards.


--- On Wed, 8/15/12, Andrew  wrote:

From: Andrew 
Subject: Re: [web2py] Grahs
To: web2py@googlegroups.com
Date: Wednesday, August 15, 2012, 6:47 AM

You may also want to look at :http://nvd3.com/ghpages/cumulativeLine.html
based on the d3js.org library.  Very Cool !
I've started using d3 visualizations fed from web2py json (or csv) uris.


On Wednesday, August 15, 2012 11:34:19 AM UTC+12, rochacbruno wrote:If it is a 
webapp you can start looking here: https://google- 
developers.appspot.com/chart/ interactive/docs/index







-- 

 

 

 

-- 





Re: [web2py] Graphs

2012-08-16 Thread Andrew
I plan to do one, but you simply provide a json or csv service / URL with 
web2py, and then use it in a view with the d3 JavaScript code.  D3 takes some 
learning, and I still have a long way to go.

-- 





Re: [web2py] Graphs

2012-08-26 Thread Alec Taylor
I've seen good things from the Flotr2 JavaScript library...
On 16/08/2012 11:26 AM, "FERNANDO VILLARROEL"  wrote:

> Thank you everyone for you help.
>
> Where i can see some how to for i can use d3 visualizations fed from
> web2py or Charts?
>
> Regards.
>
>
>
> --- On *Wed, 8/15/12, Andrew * wrote:
>
>
> From: Andrew 
> Subject: Re: [web2py] Grahs
> To: web2py@googlegroups.com
> Date: Wednesday, August 15, 2012, 6:47 AM
>
> You may also want to look at :
> http://nvd3.com/ghpages/cumulativeLine.html
>
> based on the d3js.org library.  Very Cool !
>
> I've started using d3 visualizations fed from web2py json (or csv) uris.
>
>
>
> On Wednesday, August 15, 2012 11:34:19 AM UTC+12, rochacbruno wrote:
>
> If it is a webapp you can start looking here: https://google-
> developers.appspot.com/chart/ 
> interactive/docs/index
>
>
>  --
>
>
>
>
>  --
>
>
>
>

-- 





Re: [web2py] Graphs

2012-08-26 Thread António Ramos
peepcode has a nice screencast about raphaeljs




2012/8/26 Alec Taylor 

> I've seen good things from the Flotr2 JavaScript library...
> On 16/08/2012 11:26 AM, "FERNANDO VILLARROEL" 
> wrote:
>
>> Thank you everyone for you help.
>>
>> Where i can see some how to for i can use d3 visualizations fed from
>> web2py or Charts?
>>
>> Regards.
>>
>>
>>
>> --- On *Wed, 8/15/12, Andrew * wrote:
>>
>>
>> From: Andrew 
>> Subject: Re: [web2py] Grahs
>> To: web2py@googlegroups.com
>> Date: Wednesday, August 15, 2012, 6:47 AM
>>
>> You may also want to look at :
>> http://nvd3.com/ghpages/cumulativeLine.html
>>
>> based on the d3js.org library.  Very Cool !
>>
>> I've started using d3 visualizations fed from web2py json (or csv) uris.
>>
>>
>>
>> On Wednesday, August 15, 2012 11:34:19 AM UTC+12, rochacbruno wrote:
>>
>> If it is a webapp you can start looking here: https://google-
>> developers.appspot.com/chart/ 
>> interactive/docs/index
>>
>>
>>  --
>>
>>
>>
>>
>> --
>>
>>
>>
>>
>  --
>
>
>
>

-- 





Re: [web2py] Graphs

2013-05-03 Thread FERNANDO VILLARROEL
Dear.

I am trying to make a graph temperature vs time with NVD3.js

But it's my first experience with D3 and JsON and i think i am wrong because i 
can't show graphic.

I am getting data from a database:

My controller:

def grafico_temp():
   
rows=db(db.temperaturas).select(db.temperaturas.fecha,db.temperaturas.temp).as_list()
return dict(rows=rows)

My view:

{{extend 'layout.html'}}

https://raw.github.com/novus/nvd3/master/src/nv.d3.css"; 
rel="stylesheet"/>
https://raw.github.com/novus/nvd3/master/lib/d3.v2.min.js"</a>;>
https://raw.github.com/novus/nvd3/master/nv.d3.min.js"</a>;>


#chart svg {
  height: 400px;
}



  






nv.addGraph(function() {
  var chart = nv.models.lineChart();

  chart.xAxis
  .axisLabel('Fecha')
  .tickFormat(d3.format(',r'));

  chart.yAxis
  .axisLabel('Temperatura')
  .tickFormat(d3.format('.02f'));

  d3.select('#chart svg')
  .datum(data())
.transition().duration(500)
  .call(chart);

  nv.utils.windowResize(function() { d3.select('#chart 
svg').call(chart) });

 return chart;
});



function data() {

  var camara1 =  {{=response.json(rows)}} //[];
  //var t = {{=len(rows)}};
  //{{for r in rows:}}
  //  var f = {{r.fecha}}, t = {{r.temp}};  
  //for (var i = 0; i <= t; i++) {
  //  camara1.push({x: f, y: t});
//cos.push({x: i, y: .5 * Math.cos(i/10)});
  //{{pass}}
  }

  return [
{
  values: camara1,
  key: 'Camara 1'
  color: '#ff7f0e'
},
  ];
}



I appreciated you help.

--- On Thu, 8/16/12, Andrew  wrote:

> From: Andrew 
> Subject: Re: [web2py] Graphs
> To: web2py@googlegroups.com
> Date: Thursday, August 16, 2012, 7:41 AM
> I plan to do one, but you simply
> provide a json or csv service / URL with web2py, and then
> use it in a view with the d3 JavaScript code.  D3 takes
> some learning, and I still have a long way to go.
> 
> -- 
> 
> 
> 
> 

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [web2py] Graphs

2013-05-03 Thread António Ramos
In your javascript console type d3
Do you get something?

Try this
download d3 and nvd3 files to your app static folder.
then change your code to this

{{response.files.extend([URL('static','js/d3.v2.js')])}}
{{extend 'layout.html'}}




2013/5/3 FERNANDO VILLARROEL 

> Dear.
>
> I am trying to make a graph temperature vs time with NVD3.js
>
> But it's my first experience with D3 and JsON and i think i am wrong
> because i can't show graphic.
>
> I am getting data from a database:
>
> My controller:
>
> def grafico_temp():
>
>  
> rows=db(db.temperaturas).select(db.temperaturas.fecha,db.temperaturas.temp).as_list()
> return dict(rows=rows)
>
> My view:
>
> {{extend 'layout.html'}}
>
> https://raw.github.com/novus/nvd3/master/src/nv.d3.css";
> rel="stylesheet"/>
> https://raw.github.com/novus/nvd3/master/lib/d3.v2.min.js"</a>;>
> https://raw.github.com/novus/nvd3/master/nv.d3.min.js"</a>;>
>
> 
> #chart svg {
>   height: 400px;
> }
> 
>
> 
>   
> 
>
>
>
> 
>
> nv.addGraph(function() {
>   var chart = nv.models.lineChart();
>
>   chart.xAxis
>   .axisLabel('Fecha')
>   .tickFormat(d3.format(',r'));
>
>   chart.yAxis
>   .axisLabel('Temperatura')
>   .tickFormat(d3.format('.02f'));
>
>   d3.select('#chart svg')
>   .datum(data())
> .transition().duration(500)
>   .call(chart);
>
>   nv.utils.windowResize(function() { d3.select('#chart
> svg').call(chart) });
>
>  return chart;
> });
>
>
>
> function data() {
>
>   var camara1 =  {{=response.json(rows)}} //[];
>   //var t = {{=len(rows)}};
>   //{{for r in rows:}}
>   //  var f = {{r.fecha}}, t = {{r.temp}};
>   //for (var i = 0; i <= t; i++) {
>   //  camara1.push({x: f, y: t});
> //cos.push({x: i, y: .5 * Math.cos(i/10)});
>   //{{pass}}
>   }
>
>   return [
> {
>   values: camara1,
>   key: 'Camara 1'
>   color: '#ff7f0e'
> },
>   ];
> }
> 
>
>
> I appreciated you help.
>
> --- On Thu, 8/16/12, Andrew  wrote:
>
> > From: Andrew 
> > Subject: Re: [web2py] Graphs
> > To: web2py@googlegroups.com
> > Date: Thursday, August 16, 2012, 7:41 AM
> > I plan to do one, but you simply
> > provide a json or csv service / URL with web2py, and then
> > use it in a view with the d3 JavaScript code.  D3 takes
> > some learning, and I still have a long way to go.
> >
> > --
> >
> >
> >
> >
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to web2py+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[web2py] Graphs , using of Google charts in web2py app should be easy.

2014-01-15 Thread webpypy
Hi,

It is easy, no json, no plugin.

Pass the query results to the view
return dict(projects=projects)

Copy the snippet in the view.
https://google-developers.appspot.com/chart/interactive/docs/quick_start

replace this part

data.addRows([
  ['Mushrooms', 3],
  ['Onions', 1],
  ['Olives', 1],
  ['Zucchini', 1],
  ['Pepperoni', 2]
]);

with this part

  data.addRows(7);

  {{for k,project in enumerate(projects):}}
data.setCell({{=k}}, 0, '{{= project.name}}');
data.setCell({{=k}}, 1, {{=project.value}});
  {{pass}}

Enjoy ,

Ashraf

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.