[visualization-api] Re: Drill down functionality for column charts

2014-07-30 Thread Rk MooRthy Rajendran
Hi Andrew,

Its working fine. Thank you very much for your valuable reply...

-Rk.MooRthy


On Tuesday, 29 July 2014 18:14:59 UTC+5:30, Andrew Gallant wrote:

 You should be able to replicate that chart.  Use a ComboChart 
 https://developers.google.com/chart/interactive/docs/gallery/combochart 
 to combine both columns and lines.  Use the series.series 
 index.targetAxisIndex option to assign each data series to either the left 
 (axis index 0) or right (axis index 1) y-axes.  Use the vAxes.axis index 
 option to set options for the axes (which work the same as the vAxis 
 options).  The drilldown stuff should work exactly the same.

 On Tuesday, July 29, 2014 2:33:29 AM UTC-4, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Do you have any idea to plot the above chart which i have attached..(PFA)

 The chart contains Drill down functionality and Dual Y-Axis.

 Thanks in advance..

 -Rk.MooRthy


 On Tuesday, 29 July 2014 10:32:21 UTC+5:30, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Thanks for your valuable reply..

 -Rk.Moorthy


 On Tuesday, 29 July 2014 04:36:59 UTC+5:30, Andrew Gallant wrote:

 You can use a DataView to calculate each data series as a percent of 
 the total:

 var columns = [0];
 for (var i = 1; i  data.getNumberOfColumns(); i++) {
 columns.push({
 type: 'number',
 label: data.getColumnLabel(i),
 calc: (function (x) {
 return function (dt, row) {
 var val = dt.getValue(row, x);
 var total = 0;
 for (var i = 1; i  dt.getNumberOfColumns(); i++) {
 total += dt.getValue(row, i);
 }
 var pct = val / total;
 var formattedValue = dt.getFormattedValue(row, x) + ' 
 (' + (pct * 100).toFixed(2) + '%)';
 return {v: pct, f: formattedValue};
 };
 })(i)
 });
 }
 var view = new google.visualization.DataView(data);
 view.setColumns(columns);

 On Monday, July 28, 2014 2:32:29 AM UTC-4, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Thanks for your valuable reply.

 Now i have to put drill down stacked bar chart as percentage wise.

 Do you have any idea or sample code for regarding this..???

 Thanks in Advance..

 -Rk.MooRthy

 On Saturday, 26 July 2014 06:03:56 UTC+5:30, Andrew Gallant wrote:

 Set the isStacked option to true.

 On Friday, July 25, 2014 2:19:11 AM UTC-4, Rk MooRthy Rajendran wrote:

 Hi,

 It was very useful to me, very thank to u guys.

 Now i have to add stacked bar chart for my requirement.

 Can u any one help me regarding that..???

 -Rk.MooRthy


 On Wednesday, 23 July 2014 12:38:35 UTC+5:30, Rk MooRthy Rajendran 
 wrote:

 Thanks, Its working fine

 -Rk,MooRthy


 On Tuesday, 15 January 2013 04:23:39 UTC+5:30, Choy wrote:

 Here is the format of my chart: 
 http://jsfiddle.net/asgallant/zwPuU/

 I would like to add drill down functionality - Clicking on USA 
 should yield another chart with US states etc. All the charts would 
 be 
 clickable to a drill down version. 

 I understand I have to use the selection event, could you give me 
 an example of that?

 Thanks in advance!


 On Tuesday, 29 July 2014 10:32:21 UTC+5:30, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Thanks for your valuable reply..

 -Rk.Moorthy


 On Tuesday, 29 July 2014 04:36:59 UTC+5:30, Andrew Gallant wrote:

 You can use a DataView to calculate each data series as a percent of 
 the total:

 var columns = [0];
 for (var i = 1; i  data.getNumberOfColumns(); i++) {
 columns.push({
 type: 'number',
 label: data.getColumnLabel(i),
 calc: (function (x) {
 return function (dt, row) {
 var val = dt.getValue(row, x);
 var total = 0;
 for (var i = 1; i  dt.getNumberOfColumns(); i++) {
 total += dt.getValue(row, i);
 }
 var pct = val / total;
 var formattedValue = dt.getFormattedValue(row, x) + ' 
 (' + (pct * 100).toFixed(2) + '%)';
 return {v: pct, f: formattedValue};
 };
 })(i)
 });
 }
 var view = new google.visualization.DataView(data);
 view.setColumns(columns);

 On Monday, July 28, 2014 2:32:29 AM UTC-4, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Thanks for your valuable reply.

 Now i have to put drill down stacked bar chart as percentage wise.

 Do you have any idea or sample code for regarding this..???

 Thanks in Advance..

 -Rk.MooRthy

 On Saturday, 26 July 2014 06:03:56 UTC+5:30, Andrew Gallant wrote:

 Set the isStacked option to true.

 On Friday, July 25, 2014 2:19:11 AM UTC-4, Rk MooRthy Rajendran wrote:

 Hi,

 It was very useful to me, very thank to u guys.

 Now i have to add stacked bar chart for my requirement.

 Can u any one help me regarding that..???

 -Rk.MooRthy


 On Wednesday, 23 July 2014 12:38:35 UTC+5:30, Rk MooRthy Rajendran 
 wrote:

 Thanks, Its working fine

 -Rk,MooRthy


 On Tuesday, 15 January 

Re: [visualization-api] Visualization Playground Broken Link

2014-07-30 Thread Visual1zer
Thanks for the update

Cheers,

On Tuesday, 29 July 2014 14:22:07 UTC+1, orw...@google.com wrote:

 Yep, we're investigating a fix.

 Jon


 On Tue, Jul 29, 2014 at 6:25 AM, Visual1zer flas...@gmail.com 
 javascript: wrote:

 Hi all,

 the Visualization Link appears to be broken:

 http://code.google.com/apis/ajax/playground/?type=visualization

 Is it being moved to a new address or soon to be removed from the Google 
 Charts portal?

 Cheers,

 -- 
 You received this message because you are subscribed to the Google Groups 
 Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-visualization-api+unsubscr...@googlegroups.com 
 javascript:.
 To post to this group, send email to google-visua...@googlegroups.com 
 javascript:.
 Visit this group at 
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] 404 error on Visualization Playground

2014-07-30 Thread Siddharth sreelal

Still getting a 404 error when trying to view the Playground.


On Tuesday, July 29, 2014 4:37:14 AM UTC+5:30, orw...@google.com wrote:

 Investigating...

 Jon


 On Mon, Jul 28, 2014 at 7:01 PM, James Bowler jamesm...@gmail.com 
 javascript: wrote:

 Getting a 404 when trying to view the Playground, see

 https://code.google.com/apis/ajax/playground/?type=visualization#area_chart

  -- 
 You received this message because you are subscribed to the Google Groups 
 Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-visualization-api+unsubscr...@googlegroups.com 
 javascript:.
 To post to this group, send email to google-visua...@googlegroups.com 
 javascript:.
 Visit this group at 
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] 404 error on Visualization Playground

2014-07-30 Thread 'Jon Orwant' via Google Visualization API
The playground is down for the count, alas. Security reasons.

Jon


On Wed, Jul 30, 2014 at 8:05 AM, Siddharth sreelal 
siddharth.sree...@gmail.com wrote:


 Still getting a 404 error when trying to view the Playground.


 On Tuesday, July 29, 2014 4:37:14 AM UTC+5:30, orw...@google.com wrote:

 Investigating...

 Jon


 On Mon, Jul 28, 2014 at 7:01 PM, James Bowler jamesm...@gmail.com
 wrote:

 Getting a 404 when trying to view the Playground, see
 https://code.google.com/apis/ajax/playground/?type=
 visualization#area_chart

  --
 You received this message because you are subscribed to the Google
 Groups Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-visualization-api+unsubscr...@googlegroups.com.
 To post to this group, send email to google-visua...@googlegroups.com.

 Visit this group at http://groups.google.com/
 group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google Groups
 Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-visualization-api+unsubscr...@googlegroups.com.
 To post to this group, send email to
 google-visualization-api@googlegroups.com.
 Visit this group at
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] Visualization Playground Broken Link

2014-07-30 Thread 'Jon Orwant' via Google Visualization API
The playground has been taken offline for security reasons.

Sorry,

Jon


On Wed, Jul 30, 2014 at 4:37 AM, Visual1zer flashb...@gmail.com wrote:

 Thanks for the update

 Cheers,


 On Tuesday, 29 July 2014 14:22:07 UTC+1, orw...@google.com wrote:

 Yep, we're investigating a fix.

 Jon


 On Tue, Jul 29, 2014 at 6:25 AM, Visual1zer flas...@gmail.com wrote:

 Hi all,

 the Visualization Link appears to be broken:

 http://code.google.com/apis/ajax/playground/?type=visualization

 Is it being moved to a new address or soon to be removed from the Google
 Charts portal?

 Cheers,

 --
 You received this message because you are subscribed to the Google
 Groups Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-visualization-api+unsubscr...@googlegroups.com.
 To post to this group, send email to google-visua...@googlegroups.com.

 Visit this group at http://groups.google.com/
 group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.


  --
 You received this message because you are subscribed to the Google Groups
 Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-visualization-api+unsubscr...@googlegroups.com.
 To post to this group, send email to
 google-visualization-api@googlegroups.com.
 Visit this group at
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] Visualization Playground Broken Link

2014-07-30 Thread Steve Webster
Jon, how soon could the sample code be made available for at least all the 
charts? 

On Wednesday, July 30, 2014 9:55:52 AM UTC-4, orw...@google.com wrote:

 The playground has been taken offline for security reasons. 

 Sorry,

 Jon


 On Wed, Jul 30, 2014 at 4:37 AM, Visual1zer flas...@gmail.com 
 javascript: wrote:

 Thanks for the update

 Cheers,


 On Tuesday, 29 July 2014 14:22:07 UTC+1, orw...@google.com wrote:

 Yep, we're investigating a fix.

 Jon


 On Tue, Jul 29, 2014 at 6:25 AM, Visual1zer flas...@gmail.com wrote:

 Hi all,

 the Visualization Link appears to be broken:

 http://code.google.com/apis/ajax/playground/?type=visualization

 Is it being moved to a new address or soon to be removed from the 
 Google Charts portal?

 Cheers,




-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Filter table results with a drop down menu

2014-07-30 Thread Ryan
I am pretty limited in sql and programming knowledge but i was able to 
query a google spreadsheet with code i found. Mostly from this blog 
http://katiepiatt.blogspot.com/2011/05/make-searchable-online-database-or-i.html
I customized it a bit to fit my needs.  What I would like to add, and have 
been unable to find, is a drop down menu to filter results - in addition to 
the search box already here. This is for a list of products and services. 
User will click a PS insurance from the drop down and show only entries 
with insurance in the products and services column of the spread sheet. 
Each entry may have multiple products and services. It looks like chart 
wrapper might be able to do what i want. But i have no idea and the 
playground is under construction.


Here it is:

*form id=form1 method=post action =?php echo $_SERVER['PHP_SELF']; 
? label*
*  div align=centerSearch by Name or Company*
*input id=search name=search type=text border=2/*


*  Submit empty field to reset/div*
*/label*
*label*
*  div align=center*
*input type=submit /*
*  /div*
*/label*
*/form*
*p*

*br*
*p*

*?php*
*$search= $_REQUEST['search'];*
*if ($search  ''){ $search = $search;} else { $search = '';}*
*?*

*script type=text/javascript src=http://www.google.com/jsapi;/script*
*script type=text/javascript*
*google.load('visualization', '1', {packages: ['table']});*
*/script*
*script type=text/javascript*
*var visualization;*

*function drawVisualization() {*

*var query = new google.visualization.Query(*
*'http://spreadsheets.google.com/tq?key=**pub=1');*

*query.setQuery('SELECT A, B, C, D, K, L where upper(A) like upper(%?php 
echo $search; ?%) or upper(B) like upper(%?php echo $search; ?%) 
order by A asc label A Company, B Name, C Phone, D Ext, K Email, 
L Website');*

*query.send(handleQueryResponse);*
*}*

*function handleQueryResponse(response) {*
*if (response.isError()) {*
*alert('Error in query: ' + response.getMessage() + ' ' + 
response.getDetailedMessage());*
*return;*
*}*

*var data = response.getDataTable();*

*visualization = new 
google.visualization.Table(document.getElementById('table'));*
*visualization.draw(data, {page: 'enable', pageSize: 8, 
alternatingRowStyle: true, width: '100%'});*

*}*

*google.setOnLoadCallback(drawVisualization);*
*/script*

*div id=table/div*

*/div*

-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Replace Playground with Code Examples

2014-07-30 Thread Steve Webster
Since the Charts Playground is no longer available due to security 
concerns, could you make all the code examples available. 

Perhaps copy the playground source, remove the results section (at bottom) 
thereby removing the security concern (assumption), and just the left 
column list and right column of code samples remain. My two cents :)

-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] Replace Playground with Code Examples

2014-07-30 Thread 'Jon Orwant' via Google Visualization API
That's a good idea, and we're exploring options.

Jon


On Wed, Jul 30, 2014 at 11:54 AM, Steve Webster swebste...@gmail.com
wrote:

 Since the Charts Playground is no longer available due to security
 concerns, could you make all the code examples available.

 Perhaps copy the playground source, remove the results section (at bottom)
 thereby removing the security concern (assumption), and just the left
 column list and right column of code samples remain. My two cents :)

  --
 You received this message because you are subscribed to the Google Groups
 Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-visualization-api+unsubscr...@googlegroups.com.
 To post to this group, send email to
 google-visualization-api@googlegroups.com.
 Visit this group at
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Charts Timeline error

2014-07-30 Thread Jose gerardo Renteria Valdespino


https://lh4.googleusercontent.com/-JYu-12WL984/U9lCX_sr3FI/AIQ/2tU7tC5tGGU/s1600/Sin+t%C3%ADtulo.png
Los datos desplegados en la gráfica de línea de tiempo y desplegados, no 
coinciden con los datos cargados en el script.



Alguien tiene una idea de como arreglarlo

-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] 404 error on Visualization Playground

2014-07-30 Thread James Bowler
I also noticed the links were removed .. Has it been removed permanently?

On Wednesday, July 30, 2014 6:54:38 AM UTC-7, orw...@google.com wrote:

 The playground is down for the count, alas. Security reasons.

 Jon


 On Wed, Jul 30, 2014 at 8:05 AM, Siddharth sreelal siddhart...@gmail.com 
 javascript: wrote:


 Still getting a 404 error when trying to view the Playground.


 On Tuesday, July 29, 2014 4:37:14 AM UTC+5:30, orw...@google.com wrote:

 Investigating...

 Jon


 On Mon, Jul 28, 2014 at 7:01 PM, James Bowler jamesm...@gmail.com 
 wrote:

 Getting a 404 when trying to view the Playground, see
 https://code.google.com/apis/ajax/playground/?type=
 visualization#area_chart

  -- 
 You received this message because you are subscribed to the Google 
 Groups Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send 
 an email to google-visualization-api+unsubscr...@googlegroups.com.
 To post to this group, send email to google-visua...@googlegroups.com.

 Visit this group at http://groups.google.com/
 group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.


  -- 
 You received this message because you are subscribed to the Google Groups 
 Google Visualization API group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to google-visualization-api+unsubscr...@googlegroups.com 
 javascript:.
 To post to this group, send email to google-visua...@googlegroups.com 
 javascript:.
 Visit this group at 
 http://groups.google.com/group/google-visualization-api.
 For more options, visit https://groups.google.com/d/optout.




-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


Re: [visualization-api] 404 error on Visualization Playground

2014-07-30 Thread James Bowler
I also noticed the links were removed .. Has it been removed permanently?

-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Re: 404 error on Visualization Playground

2014-07-30 Thread Anthony Stowe
When will the playground be back up?  this was way to cool to remove.. 

On Monday, July 28, 2014 6:01:56 PM UTC-5, James Bowler wrote:

 Getting a 404 when trying to view the Playground, see
 https://code.google.com/apis/ajax/playground/?type=visualization#area_chart



-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] how to do ColorFormat for cells with true/false value

2014-07-30 Thread Rashed Islam
Hi, 
 As shown in the attached file, two columns in my table will have 
true/false values. I want to do ColorFormat, so that all the false cells 
will get red background.
I tried the one shown in the attached code, but it's not working. 
Any suggestion?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.
Title: Foxhill EDA Flow Results for 07_25_2014_fh_other





  
Config : Patriot_Base_0 -- Block Level Runs
  


  
  
  




[visualization-api] Re: formatting time on the tooltip

2014-07-30 Thread Andrew Gallant
You need to format your data to get the tooltips to display properly.  If 
you are using a date or datetime data type, you can format it using a 
DateFormatter:

var formatter = new google.visualization.DateFormat({pattern: 'h:mm aa'});
formatter.format(data, 0);

If you are using a timeofday data type, you can hijack the DateFormatter 
to manually format the time by converting it to a date for formatting:

var formatter = new google.visualization.DateFormat({pattern: 'h:mm aa'});
for (var i = 0; i  data.getNumberOfRows(); i++) {
var time = data.getValue(i, 0);
if (time  time.length) {
var tmpDate = new Date(0, 0, 0, time[0], time[1] || 0, time[2] || 
0, time[3] || 0);
var timeStr = formatter.formatValue(tmpDate);
data.setFormattedValue(i, 0, timeStr);
}
}

On Wednesday, July 30, 2014 12:43:28 AM UTC-4, Neil Camara wrote:

 Hi folks,

 I currently have this code. it's only formatting the time that is on the 
 axis but not when we hover the mouse pointer on the column.

 hAxis: { format:'h:mm aa',
 gridlines: {
 count: 12
 }
 },

 In the axis, it shows the hour correctly like 3pm. However, it gets 
 displayed as 15:00 on the tooltips.

 Any help would be greatly appreciated.

 Thanks!


-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Re: Filter table results with a drop down menu

2014-07-30 Thread Andrew Gallant
From the sound of things, I think you want to use a CategoryFilter.  Here's 
some example javascript you can use to get started:

function drawVisualization() {
var query = new 
google.visualization.Query('http://spreadsheets.google.com/tq?key=**pub=1');

query.setQuery('SELECT A, B, C, D, K, L where upper(A) like 
upper(%?php echo $search; ?%) or upper(B) like upper(%?php echo 
$search; ?%) order by A asc label A Company, B Name, C Phone, D 
Ext, K Email, L Website');

query.send(handleQueryResponse);
}
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' + 
response.getDetailedMessage());
return;
}

var data = response.getDataTable();

var table = new google.visualization.ChartWrapper({
chartType: 'Table',
containerId: 'table',
options: {
page: 'enable',
pageSize: 8,
alternatingRowStyle: true,
width: '100%'
}
});

var filter = new google.visualization.ControlWrapper({
controlType: 'CategoryFilter',
containerId: 'filter',
options: {
filterColumnIndex: 0 // assumes you want to filter the first 
column
}
});

var dashboard = new 
google.visualization.Dashboard(document.querySelector('#dashboard'));
dashboard.bind([filter], [table]);
dashboard.draw(data);
}
google.load('visualization', '1', {packages:['controls'], callback: 
drawVisualization});

and in HTML:

div id=dashboard
div id=filter/div
div id=table/div
/div

On Wednesday, July 30, 2014 10:33:30 AM UTC-4, Ryan wrote:

 I am pretty limited in sql and programming knowledge but i was able to 
 query a google spreadsheet with code i found. Mostly from this blog 
 http://katiepiatt.blogspot.com/2011/05/make-searchable-online-database-or-i.html
 I customized it a bit to fit my needs.  What I would like to add, and have 
 been unable to find, is a drop down menu to filter results - in addition to 
 the search box already here. This is for a list of products and services. 
 User will click a PS insurance from the drop down and show only entries 
 with insurance in the products and services column of the spread sheet. 
 Each entry may have multiple products and services. It looks like chart 
 wrapper might be able to do what i want. But i have no idea and the 
 playground is under construction.


 Here it is:

 *form id=form1 method=post action =?php echo $_SERVER['PHP_SELF']; 
 ? label*
 *  div align=centerSearch by Name or Company*
 *input id=search name=search type=text border=2/*
 
 
 *  Submit empty field to reset/div*
 */label*
 *label*
 *  div align=center*
 *input type=submit /*
 *  /div*
 */label*
 */form*
 *p*

 *br*
 *p*

 *?php*
 *$search= $_REQUEST['search'];*
 *if ($search  ''){ $search = $search;} else { $search = '';}*
 *?*

 *script type=text/javascript src=http://www.google.com/jsapi 
 http://www.google.com/jsapi/script*
 *script type=text/javascript*
 *google.load('visualization', '1', {packages: ['table']});*
 */script*
 *script type=text/javascript*
 *var visualization;*

 *function drawVisualization() {*

 *var query = new google.visualization.Query(*
 *'http://spreadsheets.google.com/tq?key=**pub=1' 
 http://spreadsheets.google.com/tq?key=**pub=1');*

 *query.setQuery('SELECT A, B, C, D, K, L where upper(A) like upper(%?php 
 echo $search; ?%) or upper(B) like upper(%?php echo $search; ?%) 
 order by A asc label A Company, B Name, C Phone, D Ext, K Email, 
 L Website');*

 *query.send(handleQueryResponse);*
 *}*

 *function handleQueryResponse(response) {*
 *if (response.isError()) {*
 *alert('Error in query: ' + response.getMessage() + ' ' + 
 response.getDetailedMessage());*
 *return;*
 *}*

 *var data = response.getDataTable();*

 *visualization = new 
 google.visualization.Table(document.getElementById('table'));*
 *visualization.draw(data, {page: 'enable', pageSize: 8, 
 alternatingRowStyle: true, width: '100%'});*

 *}*

 *google.setOnLoadCallback(drawVisualization);*
 */script*

 *div id=table/div*

 */div*



-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Re: Charts Timeline error

2014-07-30 Thread Andrew Gallant
Those dates are correct.  Javascript uses a zero-based index for months, so 
all of the month numbers are 1 lower than most date systems (ie. January is 
0, February is 1, March is 2, etc...).

On Wednesday, July 30, 2014 3:07:23 PM UTC-4, Jose gerardo Renteria 
Valdespino wrote:


 https://lh4.googleusercontent.com/-JYu-12WL984/U9lCX_sr3FI/AIQ/2tU7tC5tGGU/s1600/Sin+t%C3%ADtulo.png
 Los datos desplegados en la gráfica de línea de tiempo y desplegados, no 
 coinciden con los datos cargados en el script.



 Alguien tiene una idea de como arreglarlo


-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Re: how to do ColorFormat for cells with true/false value

2014-07-30 Thread Andrew Gallant
The ColorFormatter only works on number data type, so you can't use it 
with your boolean values, but you can emulate its effect.  The 
ColorFormatter changes the style property of the DataTable cells, which 
the Table visualization assigns as the style attribute of the td's, so all 
you have to do is parse the DataTable and set the style property of the 
boolean cells:

for (var i = 0; i  data.getNumberOfRows(); i++) {
if (data.getValue(i, 7)) {
data.setProperty(i, 7, 'style', 'background-color: red');
}
else {
data.setProperty(i, 7, 'style', 'background-color: white');
}
if (data.getValue(i, 8)) {
data.setProperty(i, 8, 'style', 'background-color: red');
}
else {
data.setProperty(i, 8, 'style', 'background-color: white');
}
}

On Wednesday, July 30, 2014 7:03:49 PM UTC-4, Rashed Islam wrote:

 Hi, 
  As shown in the attached file, two columns in my table will have 
 true/false values. I want to do ColorFormat, so that all the false cells 
 will get red background.
 I tried the one shown in the attached code, but it's not working. 
 Any suggestion?

 Thanks.


-- 
You received this message because you are subscribed to the Google Groups 
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.


[visualization-api] Re: I'd like to commission someone to write a fairly basic line chart. Interested?

2014-07-30 Thread 66splitbus
Andrew, wow, thanks again,  Im dying to see this working!  I changed the 
path per your instructions but cant seem to get the page to render 
properly.  I have it in the root dir of my web server but if I open a 
browser and point to that file it comes up as a white page.  If I view the 
source I see it exactly as the page is saved, its like it didnt execute the 
html code just loaded the page.  Does that make sense?  If I point to my 
index.html file that works fine.  
Im using IIS on Windows 7 to serve the page.  Anything special I need to 
turn on?


On Monday, July 28, 2014 4:48:17 PM UTC-7, Andrew Gallant wrote:

 Storing the CSV file inside your web directory makes this much easier, as 
 this allows you to use AJAX to fetch the data directly instead of writing 
 some server-sude code to get the CSV.  The jQuery library provides a handy 
 shortcut for writing AJAX:

 $.ajax({
 url: '/path/to/data.csv', // this is the path in your web directory, 
 not your system directory
 dataType: 'text',
 success: function (csv) {
 // code to draw chart
 }
 });

 I attached an HTML file that ties all of this together.

 On Sunday, July 27, 2014 2:01:35 PM UTC-4, 66spl...@gmail.com wrote:

 Wow, thank you so much Andrew.  I would have never figured that parsing 
 out...

 Either one of those examples to turn stuff on or off would work.  The 
 site is going to be only accessed by me so it doesnt have to be super sexy.

 The csv file is hosted on the machine that is running the webserver.  I 
 can store its location anywhere including the root dir of the website. 
  Hopefully that makes it a bit easier.
 Thanks again for all your help on this!


 On Sunday, July 27, 2014 6:23:30 AM UTC-7, Andrew Gallant wrote:

 For turning on and off the lines, would either of these work for you?

 http://jsfiddle.net/asgallant/WaUu2/
 http://jsfiddle.net/asgallant/6gz2Q/

 If you can't change the format of the CSV, then you'll have to manually 
 parse it, but your structure is simple enough that this shouldn't present a 
 problem.  Once it is loaded in the browser, this should suffice to 
 transform it into a DataTable for the charts:

 function csvToDataTable (csv) {
 // split the csv on line breaks
 var csvRows = csv.split(/\r{0,1}\n/g);
 var rawData = [], row, match, year, month, day, hours, minutes, 
 seconds;
 for (var i = 0; i  csvRows.length; i++) {
 row = csvRows[i].split(',');
 if (i != 0) {
 // assumes dates are in the format MM/dd/ HH:mm:ss
 match = row[0].match(/(\d{2})\/(\d{2})\/(\d{4}) 
 (\d{2}):(\d{2}):(\d{2})/);
 year = parseInt(match[3], 10);
 month = parseInt(match[1], 10) - 1; // convert to 
 javascript's zero-indexed months
 day = parseInt(match[2], 10);
 hours = parseInt(match[4], 10);
 minutes = parseInt(match[5], 10);
 seconds = parseInt(match[6], 10);
 row[0] = new Date(year, month, day, hours, minutes, seconds);
 for (var j = 1; j  row.length; j++) {
 // convert the strings to numbers
 // change to parseFloat if your numbers can be floats
 row[j] = parseInt(row[j]);
 }
 }
 rawData.push(row);
 }
 return google.visualization.arrayToDataTable(rawData);
 }

 Loading the data might be a bit tricky; is this going to be hosted on 
 your local PC or on a website?  Do you have the choice of where the CSV 
 gets stored?

 On Saturday, July 26, 2014 2:40:51 PM UTC-4, 66spl...@gmail.com wrote:

 Well Im certainly willing to try.  I've looked a bunch of examples but 
 just cant seem to get my data loaded,at least if I include the date field. 
  I manually put a ' ' around date and that worked except I have no control 
 over the format of the csv to actually include those ' '

 But sure, lets give this a shot.  

 By turning off / isolate values I have 10 temperatures, I'd like to be 
 able to display just one or two of them or all 10.  Having 10 lines gets a 
 bit messy, plus this might grow to more in the future.

 Both of those zooms are brilliant.  I was checking out the google 
 example when I was researching this the last couple weeks, thats exactly 
 what I was envisioning.

 Thanks for offering to help out!


 On Friday, July 25, 2014 6:36:49 PM UTC-7, Andrew Gallant wrote:

 This is probably easy to do, and if you're feeling adventurous, we can 
 help you save a bit of cash and do this yourself.

 A few key questions:'

 What do you mean by turn off / isolate certain values?

 Would something like this 
 https://developers.google.com/chart/interactive/docs/gallery/controls#chartrangefilter
  or 
 this http://jsfiddle.net/asgallant/fgM4V/ work for you to zoom your 
 data?

 On Friday, July 25, 2014 2:26:08 PM UTC-4, 66spl...@gmail.com wrote:

 I have a few bucks to pay someone to write a fairly basic chart for 
 me.  I have a csv file on the local 

[visualization-api] Re: Drill down functionality for column charts

2014-07-30 Thread Rk MooRthy Rajendran
Hi Andrew,

I have to plot charts using Google API with web service data, The web 
service result is in Json format.

So need to convert the Json format into Multi dimensional array for render 
the chart.

This is my web service data : 

[{categories1: [TOTAL,GROUND FLOOR-GOLD,FIRST FLOOR-GOLD,FIRST 
FLOOR-DIAMOND,FIRST FLOOR-PLATINUM,SECOND 
FLOOR-GOLD,YOUNGONES-GOLD,YOUNGONES-DIAMOND,YOUNGONES-PLATINUM,YOUNGONES-SILVER,SILVERMINE-GF,SILVERMINE-FF,SILVER
 
JEWELLERY,HANDICRAFT], 
convToSales1:[77131,22556,3998,1187,315,5626,6683,151,48,3427,19984,4972,7042,1142],NotConvSales1:[10073,2751,630,266,67,1001,955,68,15,221,2629,1094,321,55]}]

Need to convert the above json into following format :

[['Categories','ConvToSales','NotConvSales'],
 ['YOUNGONES-DIAMOND',126,514],['YOUNGONES-PLATINUM',555,552],
 ['YOUNGONES-SILVER',645,154],['SILVERMINE-GF',5029,687],
 ['SILVER JEWELLERY',164,179],['HANDICRAFT',335,212]]


Do you have any idea to converting the data 

Thanks in Advance..


-Rk.MooRthy


On Wednesday, 30 July 2014 11:48:35 UTC+5:30, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Its working fine. Thank you very much for your valuable reply...

 -Rk.MooRthy


 On Tuesday, 29 July 2014 18:14:59 UTC+5:30, Andrew Gallant wrote:

 You should be able to replicate that chart.  Use a ComboChart 
 https://developers.google.com/chart/interactive/docs/gallery/combochart 
 to combine both columns and lines.  Use the series.series 
 index.targetAxisIndex option to assign each data series to either the left 
 (axis index 0) or right (axis index 1) y-axes.  Use the vAxes.axis index 
 option to set options for the axes (which work the same as the vAxis 
 options).  The drilldown stuff should work exactly the same.

 On Tuesday, July 29, 2014 2:33:29 AM UTC-4, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Do you have any idea to plot the above chart which i have attached..(PFA)

 The chart contains Drill down functionality and Dual Y-Axis.

 Thanks in advance..

 -Rk.MooRthy


 On Tuesday, 29 July 2014 10:32:21 UTC+5:30, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Thanks for your valuable reply..

 -Rk.Moorthy


 On Tuesday, 29 July 2014 04:36:59 UTC+5:30, Andrew Gallant wrote:

 You can use a DataView to calculate each data series as a percent of 
 the total:

 var columns = [0];
 for (var i = 1; i  data.getNumberOfColumns(); i++) {
 columns.push({
 type: 'number',
 label: data.getColumnLabel(i),
 calc: (function (x) {
 return function (dt, row) {
 var val = dt.getValue(row, x);
 var total = 0;
 for (var i = 1; i  dt.getNumberOfColumns(); i++) {
 total += dt.getValue(row, i);
 }
 var pct = val / total;
 var formattedValue = dt.getFormattedValue(row, x) + ' 
 (' + (pct * 100).toFixed(2) + '%)';
 return {v: pct, f: formattedValue};
 };
 })(i)
 });
 }
 var view = new google.visualization.DataView(data);
 view.setColumns(columns);

 On Monday, July 28, 2014 2:32:29 AM UTC-4, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Thanks for your valuable reply.

 Now i have to put drill down stacked bar chart as percentage wise.

 Do you have any idea or sample code for regarding this..???

 Thanks in Advance..

 -Rk.MooRthy

 On Saturday, 26 July 2014 06:03:56 UTC+5:30, Andrew Gallant wrote:

 Set the isStacked option to true.

 On Friday, July 25, 2014 2:19:11 AM UTC-4, Rk MooRthy Rajendran 
 wrote:

 Hi,

 It was very useful to me, very thank to u guys.

 Now i have to add stacked bar chart for my requirement.

 Can u any one help me regarding that..???

 -Rk.MooRthy


 On Wednesday, 23 July 2014 12:38:35 UTC+5:30, Rk MooRthy Rajendran 
 wrote:

 Thanks, Its working fine

 -Rk,MooRthy


 On Tuesday, 15 January 2013 04:23:39 UTC+5:30, Choy wrote:

 Here is the format of my chart: 
 http://jsfiddle.net/asgallant/zwPuU/

 I would like to add drill down functionality - Clicking on USA 
 should yield another chart with US states etc. All the charts would 
 be 
 clickable to a drill down version. 

 I understand I have to use the selection event, could you give me 
 an example of that?

 Thanks in advance!


 On Tuesday, 29 July 2014 10:32:21 UTC+5:30, Rk MooRthy Rajendran wrote:

 Hi Andrew,

 Thanks for your valuable reply..

 -Rk.Moorthy


 On Tuesday, 29 July 2014 04:36:59 UTC+5:30, Andrew Gallant wrote:

 You can use a DataView to calculate each data series as a percent of 
 the total:

 var columns = [0];
 for (var i = 1; i  data.getNumberOfColumns(); i++) {
 columns.push({
 type: 'number',
 label: data.getColumnLabel(i),
 calc: (function (x) {
 return function (dt, row) {
 var val = dt.getValue(row, x);
 var total = 0;
 for (var i = 1; i  dt.getNumberOfColumns(); i++) {
 total += dt.getValue(row, i);
 }