[visualization-api] Re: Read data from a database and show it in Google Charts

2015-06-25 Thread Nitesh Parajuli
mysql_select_db($databaseName, $con); 
this line is sending me html codes.why is that??  anyone??

On Tuesday, February 26, 2013 at 3:04:09 AM UTC+5:45, asgallant wrote:
>
> You have to format the data returned by your query into the JSON format 
> expected by the DataTable constructor.  Here's a basic PHP script that you 
> can work from:
>
>  /* $server = the IP address or network name of the server
>  * $userName = the user to log into the database with
>  * $password = the database account password
>  * $databaseName = the name of the database to pull data from
>  */
> $con = mysql_connect($server, $userName, $password) or die('Error 
> connecting to server');
>  
> mysql_select_db($databaseName, $con); 
>
> // write your SQL query here (you may use parameters from $_GET or $_POST 
> if you need them)
> $query = mysql_query('SELECT column1, column2, column3 FROM myTable');
>
> $table = array();
> $table['cols'] = array(
> /* define your DataTable columns here
>  * each column gets its own array
>  * syntax of the arrays is:
>  * label => column label
>  * type => data type of column (string, number, date, datetime, boolean)
>  */
> array('label' => 'Label of column 1', 'type' => 'string'),
> array('label' => 'Label of column 2', 'type' => 'number'),
> array('label' => 'Label of column 3', 'type' => 'number')
> // etc...
> );
>
> $rows = array();
> while($r = mysql_fetch_assoc($query)) {
> $temp = array();
> // each column needs to have data inserted via the $temp array
> $temp[] = array('v' => $r['column1']);
> $temp[] = array('v' => $r['column2']);
> $temp[] = array('v' => $r['column3']);
> // etc...
>  // insert the temp array into $rows
> $rows[] = array('c' => $temp);
> }
>
> // populate the table with rows of data
> $table['rows'] = $rows;
>
> // encode the table as JSON
> $jsonTable = json_encode($table);
>
> // set up header; first two prevent IE from caching queries
> header('Cache-Control: no-cache, must-revalidate');
> header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
> header('Content-type: application/json');
>
> // return the JSON data
> echo $jsonTable;
> ?>
>
> On Monday, February 25, 2013 3:58:55 PM UTC-5, akshita gupta wrote:
>>
>> Hello.. I am unable to display chart. Please help. I am unable to figure 
>> out the problem. 
>>
>> getdata.php
>>
>> >
>> mysql_connect('localhost','akshita','123456');
>> mysql_select_db('rcusers');
>>
>> $sqlquery1="select userid,group_name,req_nodes,actualPE from jobs 
>> 
>>  where userid='zhang' limit 200";
>>
>> $sqlresult1=mysql_query($sqlquery1);
>>
>> $rows=array();
>> while($r=mysql_fetch_assoc($sqlresult1)){
>> $rows[]=$r;}print json_encode($rows);?>
>>
>> chartDraw.php
>> > src="https://www.google.com/jsapi";>> src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"; 
>> type="text/javascript">
>> 
>> //Load the visualization API and the piechart package
>> google.load('visualization','1',{'packages':['corechart']});
>> //Set a callback to run when the google visualization API is loaded
>> google.setOnLoadCallback(drawchart);
>> function drawChart(){
>>   var jsonData = $.ajax({
>> url:"getData.php",
>> dataType:"json",
>> async:false
>> }).responseText;
>> //Create our data table out of JSON data loaded from servervar data=new 
>> google.visualization.DataTable(jsonData);
>> //Instantiate and draw our chart 
>> <http://stackoverflow.com/questions/15073654/unable-to-extract-data-to-get-google-chart-nothing-is-being-displayed-but-getda/15073745#>,
>>  passing in some optionsvar chart=new 
>> google.visualization.PieChart(document.getElementById('chart_div'));
>> chart.draw(data,{width:400,height:240});}
>> 
>> 
>> 
>> 
>>
>>
>>
>> On Tuesday, 26 July 2011 15:24:36 UTC-4, GerBen wrote:
>>>
>>> Hello Colleagues, 
>>> How can I read data from an external database (say, MS SQL Server or 
>>> MySQL) and show it in a Google Chart? 
>>> Thank you.
>>
>>

-- 
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: Read data from a database and show it in Google Charts

2015-06-25 Thread Nitesh Parajuli
Anyone :) 
I dont understand whats happening..do you know why is this happening??


On Wednesday, July 27, 2011 at 1:09:36 AM UTC+5:45, GerBen wrote:
>
> Hello Colleagues, 
> How can I read data from an external database (say, MS SQL Server or 
> MySQL) and show it in a Google Chart? 
> Thank you.

-- 
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] Re: Read data from a database and show it in Google Charts

2015-06-25 Thread Preethi R
Are you telling me ?

On Thursday, June 25, 2015, Nitesh Parajuli 
wrote:

> i am getting some html codes above the json part..what can i do??
>
>
> 
>  border='1' cellspacing='0' cellpadding='1'>
>  style='background-color: #cc; color: #fce94f; font-size: x-large;'>( ! 
> ) SCREAM: Error suppression ignored for
>  style='background-color: #cc; color: #fce94f; font-size: x-large;'>( ! 
> ) Notice: Use of undefined constant graph - assumed 'graph' in 
> C:\wamp\www\tapaikoshare\graph\open.php on line 9
> Call Stack
> # bgcolor='#ec'>TimeMemory align='left' bgcolor='#ec'>Function bgcolor='#ec'>Location
> 1 align='center'>0.0005250952 bgcolor='#ec'>{main}(  ) title='C:\wamp\www\tapaikoshare\graph\open.php' 
> bgcolor='#ec'>..\open.php:0
> 
> {"cols":[{"label":"user_id","type":"string"},{"label":"name","type":"string"},{"label":"old_salary","type":"number"},{"label":"new_salary","type":"number"}],"rows":[{"c":[{"v":"U1"},{"v":"Nitesh"},{"v":100},{"v":500}]},{"c":[{"v":"U2"},{"v":"Samundra"},{"v":50},{"v":150}]}]}
>
>
> On Wednesday, July 27, 2011 at 1:09:36 AM UTC+5:45, GerBen wrote:
>>
>> Hello Colleagues,
>> How can I read data from an external database (say, MS SQL Server or
>> MySQL) and show it in a Google Chart?
>> Thank you.
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "Google Visualization API" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/google-visualization-api/UdOFybnvFo0/unsubscribe
> .
> To unsubscribe from this group and all its topics, 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] Bar chart with Stripes instead of color

2015-06-25 Thread gaurav bhandari
Hi,
I want to create a chart like -


Can anyone help me on how to do it?
I have looked everywhere but it seems that the visualization does not take 
anything else other than color.

Regards,
Gaurav

-- 
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: Read data from a database and show it in Google Charts

2015-06-25 Thread Nitesh Parajuli


i am getting some html codes above the json part..what can i do??




( ! 
) SCREAM: Error suppression ignored for
( ! 
) Notice: Use of undefined constant graph - assumed 'graph' in 
C:\wamp\www\tapaikoshare\graph\open.php on line 9
Call Stack
#TimeMemoryFunctionLocation
10.0005250952{main}(  )..\open.php:0

{"cols":[{"label":"user_id","type":"string"},{"label":"name","type":"string"},{"label":"old_salary","type":"number"},{"label":"new_salary","type":"number"}],"rows":[{"c":[{"v":"U1"},{"v":"Nitesh"},{"v":100},{"v":500}]},{"c":[{"v":"U2"},{"v":"Samundra"},{"v":50},{"v":150}]}]}


On Wednesday, July 27, 2011 at 1:09:36 AM UTC+5:45, GerBen wrote:
>
> Hello Colleagues, 
> How can I read data from an external database (say, MS SQL Server or 
> MySQL) and show it in a Google Chart? 
> Thank you.

-- 
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] Is the Google Linear Trendline the Pearson Correlation?

2015-06-25 Thread aloha rich
Looking at the docs here, it isnt' clear (to me at least) if this linear 
trendline (on a scatter chart) is the Pearson Correlation?

If so, any way to get the R value from the API?

https://developers.google.com/chart/interactive/docs/gallery/trendlines

Thanks,

Rich

-- 
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 save Chart in a chartwrwpper to an image

2015-06-25 Thread Mike Pala
Thank you kind sir! I salute you and shall toast you with my finest wine!

On Monday, June 22, 2015 at 3:31:24 PM UTC+2, Daniel Buttery wrote:
>
> To get an image version of a chart in a chartwrapper, you need to use 
> .getChart().getImageURI() 
> (so in your case wrapper.getChart().getImageURI() ). Heres a fiddle I 
> threw together for someone previously who had the same question: 
> https://jsfiddle.net/kujxsn7z/ 
>
> On Monday, 15 June 2015 19:34:23 UTC+1, Mike Pala wrote:
>>
>> I have a chart in a google ChartWrapper which is created by the 
>> ChartEditor
>>
>>  function loadEditor() {
>>
>> var data = new google.visualization.DataTable()
>>   wrapper = new google.visualization.ChartWrapper({
>>
>>  dataTable: data,
>>  left:1,
>>  options: {
>>  'chartArea': {width: '60%', left: 45},
>>  'legend' :'none',
>>
>>  'title':'Number of Newly Opened Roles per '
>>  }
>>
>>   });
>>
>>
>>   chartEditor = new google.visualization.ChartEditor();
>>   google.visualization.events.addListener(chartEditor, 'ok', redrawChart);
>>
>>   chartEditor.openDialog(wrapper, {});}
>>
>> I now need another function linked to a button which will save that chart 
>> to an image file. Canvas2html does not work. It drops all formatting and 
>> colors, columns are not visible, and the text (labels, legends, values, 
>> etc) overlaps and is smooshed together.
>>
>

-- 
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] Google Chart Array with Datetime. Which is the best format?

2015-06-25 Thread Pedro Vieira
Hello,


I have an array populating my DataTable. I tryed different date formats 
with date, datetime and string (only to test!).
Whats is the best approach and format to bring my time data to plot in a 
column chart? (I can manipulate time before loading into Google Chart)

Thanks.

My code:

var data = new google.visualization.DataTable();
data.addColumn('datetime', '_time'); // 

...

var rows = Data13.data().rows.slice();

...

data.addRows(rows);

...



My Array:

0: Array[7]0: "2015-02-10T00:00:00.000+00:00"1: 82: 523: 104: 15: 864006: 
1length: 7__proto__: Array[0]1: Array[7]

Tried date formats:

2015-02-10T00:00:00+
2015-02-10T00:00:00.000+00:00
EPOCH+Milliseconds

My Console:

Uncaught Error: Type mismatch. Value 2015-02-10T00:00:00.000+00:00 does not 
match type datetime in column index 0




-- 
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] Different color for each day of the week for a column chart?

2015-06-25 Thread zub zeb
Thank you very much.  I will doing some more mucking about, but I think you 
put me on the right track.

On Thursday, June 25, 2015 at 1:33:23 PM UTC-4, Daniel LaLiberte wrote:
>
> We have a documentation page on dates and times at: 
> https://developers.google.com/chart/interactive/docs/datesandtimes
>
> As mentioned on that page, since you are using JSON, you will probably 
> want to put your dates in a string notation that looks like "Date(2015, 5, 
> 25)".  Note the months are 0-based.
>
> Your number values are only in a single column, so there is no way to 
> specify colors associated with series that way.  You would have to 
> structure your data in multiple columns to get a different series for each 
> column.
>
> But alternatively, you can assign a color for each value that overrides 
> the series color, by adding another column that has role: 'style'.  See 
> https://developers.google.com/chart/interactive/docs/roles
>
>
> On Thu, Jun 25, 2015 at 1:00 PM, zub zeb  > wrote:
>
> Hi Daniel,
>
> Below is a sample of what I'm pulling when I view source.  I can see where 
> I might be going wrong now though being that I have the date formatted as a 
> string though.  I tried to switch it to date format, but it caused the 
> chart to fail.  I'm trying to sort out that issue now too.  I'm guessing 
> the charts are pretty picky about the format in which they receive their 
> date values from mySQL.  I'm reading up on that now too and trying to use 
> the information in this thread to sort it out:  
> http://stackoverflow.com/questions/24929767/mysql-datetime-in-google-chart
>  
>
> Anywho...  I would appreciate any direction on this one.  If you have a 
> better source, I sure don't mind reading up on how to sort this out.  
> Thanks.
>
> var data = new 
> google.visualization.DataTable({"cols":[{"label":"Date","type":"string"},{"label":"Daily
>  
> Usage","type":"number"}],"rows":[{"c":[{"v":"2012-01-01"},{"v":153}]},{"c":[{"v":"2012-01-02"},{"v":160}]},{"c":[{"v":"2012-01-03"},{"v":179}]},{"c":[{"v":"2012-01-04"},{"v":171}]},{"c":[{"v":"2012-01-05"},{"v":169}]},{"c":[{"v":"2012-01-06"},{"v":196}]},{"c":[{"v":"2012-01-07"},{"v":205}]},{"c":[{"v":"2012-01-08"},{"v":196}]},{"c":[{"v":"2012-01-09"},{"v":202}]},{"c":[{"v":"2012-01-10"},{"v":213}]},{"c":[{"v":"2012-01-11"},{"v":189}]},{"c":[{"v":"2012-01-12"},{"v":214}]},{"c":[{"v":"2012-01-13"},{"v":193}]},{"c":[{"v":"2012-01-14"},{"v":185}]},{"c":[{"v":"2012-01-15"},{"v":204}]},{"c":[{"v":"2012-01-16"},{"v":206}]},{"c":[{"v":"2012-01-17"},{"v":209}]},{"c":[{"v":"2012-01-18"},{"v":212}]},{"c":[{"v":"2012-01-19"},{"v":219}]},{"c":[{"v":"2012-01-20"},{"v":207}]},{"c":[{"v":"2012-01-21"},{"v":196}]},{"c":[{"v":"2012-01-22"},{"v":213}]},{"c":[{"v":"2012-01-23"},{"v":209}]},{"c":[{"v":"2012-01-24"},{"v":215}]},{"c":[{"v":"2012-01-25"},{"v":205}]},{"c":[{"v":"2012-01-26"},{"v":211}]},{"c":[{"v":"2012-01-27"},{"v":205}]},{"c":[{"v":"2012-01-28"},{"v":201}]},{"c":[{"v":"2012-01-29"},{"v":205}]},{"c":[{"v":"2012-01-30"},{"v":212}]},{"c":[{"v":"2012-01-31"},{"v":204}]},{"c":[{"v":"2012-02-01"},{"v":209}]},{"c":[{"v":"2012-02-02"},{"v":202}]},{"c":[{"v":"2012-02-03"},{"v":215}]},{"c":[{"v":"2012-02-04"},{"v":214}]},{"c":[{"v":"2012-02-05"},{"v":187}]},{"c":[{"v":"2012-02-06"},{"v":203}]},{"c":[{"v":"2012-02-07"},{"v":211}]},{"c":[{"v":"2012-02-08"},{"v":216}]},{"c":[{"v":"2012-02-09"},{"v":206}]},{"c":[{"v":"2012-02-10"},{"v":209}]},{"c":[{"v":"2012-02-11"},{"v":195}]},{"c":[{"v":"2012-02-12"},{"v":199}]},{"c":[{"v":"2012-02-13"},{"v":217}]},{"c":[{"v":"2012-02-14"},{"v":209}]},{"c":[{"v":"2012-02-15"},{"v":214}]},{"c":[{"v":"2012-02-16"},{"v":219}]},{"c":[{"v":"2012-02-17"},{"v":219}]},{"c":[{"v":"2012-02-18"},{"v":216}]},{"c":[{"v":"2012-02-19"},{"v":213}]},{"c":[{"v":"2012-02-20"},{"v":204}]},{"c":[{"v":"2012-02-21"},{"v":199}]},{"c":[{"v":"2012-02-22"},{"v":204}]},{"c":[{"v":"2012-02-23"},{"v":195}]},{"c":[{"v":"2012-02-24"},{"v":190}]},{"c":[{"v":"2012-02-25"},{"v":199}]},{"c":[{"v":"2012-02-26"},{"v":211}]},{"c":[{"v":"2012-02-27"},{"v":193}]},{"c":[{"v":"2012-02-28"},{"v":198}]},{"c":[{"v":"2012-02-29"},{"v":202}]},{"c":[{"v":"2012-03-01"},{"v":202}]},{"c":[{"v":"2012-03-02"},{"v":199}]},{"c":[{"v":"2012-03-03"},{"v":223}]},{"c":[{"v":"2012-03-04"},{"v":183}]},{"c":[{"v":"2012-03-05"},{"v":204}]},{"c":[{"v":"2012-03-06"},{"v":204}]},{"c":[{"v":"2012-03-07"},{"v":211}]},{"c":[{"v":"2012-03-08"},{"v":213}]},{"c":[{"v":"2012-03-09"},{"v":194}]},{"c":[{"v":"2012-03-10"},{"v":215}]},{"c":[{"v":"2012-03-11"},{"v":201}]},{"c":[{"v":"2012-03-12"},{"v":211}]},{"c":[{"v":"2012-03-13"},{"v":218}]},{"c":[{"v":"2012-03-14"},{"v":212}]},{"c":[{"v":"2012-03-15"},{"v":210}]},{"c":[{"v":"2012-03-16"},{"v":0}]}]});
>
>
>
>
> On Thursday, June 25, 2015 at 9:56:10 AM UTC-4, Daniel LaLiberte wrote:
>
> Zub zeb,
>
> Does your DataTable have one column for each of your series?   Can you 
> give an example of what your data looks like, perhaps in the form of an 
> array of arrays that

Re: [visualization-api] Different color for each day of the week for a column chart?

2015-06-25 Thread 'Daniel LaLiberte' via Google Visualization API
We have a documentation page on dates and times at:
https://developers.google.com/chart/interactive/docs/datesandtimes

As mentioned on that page, since you are using JSON, you will probably want
to put your dates in a string notation that looks like "Date(2015, 5,
25)".  Note the months are 0-based.

Your number values are only in a single column, so there is no way to
specify colors associated with series that way.  You would have to
structure your data in multiple columns to get a different series for each
column.

But alternatively, you can assign a color for each value that overrides the
series color, by adding another column that has role: 'style'.  See
https://developers.google.com/chart/interactive/docs/roles


On Thu, Jun 25, 2015 at 1:00 PM, zub zeb  wrote:

> Hi Daniel,
>
> Below is a sample of what I'm pulling when I view source.  I can see where
> I might be going wrong now though being that I have the date formatted as a
> string though.  I tried to switch it to date format, but it caused the
> chart to fail.  I'm trying to sort out that issue now too.  I'm guessing
> the charts are pretty picky about the format in which they receive their
> date values from mySQL.  I'm reading up on that now too and trying to use
> the information in this thread to sort it out:
> http://stackoverflow.com/questions/24929767/mysql-datetime-in-google-chart
>
>
> Anywho...  I would appreciate any direction on this one.  If you have a
> better source, I sure don't mind reading up on how to sort this out.
> Thanks.
>
> var data = new 
> google.visualization.DataTable({"cols":[{"label":"Date","type":"string"},{"label":"Daily
>  
> Usage","type":"number"}],"rows":[{"c":[{"v":"2012-01-01"},{"v":153}]},{"c":[{"v":"2012-01-02"},{"v":160}]},{"c":[{"v":"2012-01-03"},{"v":179}]},{"c":[{"v":"2012-01-04"},{"v":171}]},{"c":[{"v":"2012-01-05"},{"v":169}]},{"c":[{"v":"2012-01-06"},{"v":196}]},{"c":[{"v":"2012-01-07"},{"v":205}]},{"c":[{"v":"2012-01-08"},{"v":196}]},{"c":[{"v":"2012-01-09"},{"v":202}]},{"c":[{"v":"2012-01-10"},{"v":213}]},{"c":[{"v":"2012-01-11"},{"v":189}]},{"c":[{"v":"2012-01-12"},{"v":214}]},{"c":[{"v":"2012-01-13"},{"v":193}]},{"c":[{"v":"2012-01-14"},{"v":185}]},{"c":[{"v":"2012-01-15"},{"v":204}]},{"c":[{"v":"2012-01-16"},{"v":206}]},{"c":[{"v":"2012-01-17"},{"v":209}]},{"c":[{"v":"2012-01-18"},{"v":212}]},{"c":[{"v":"2012-01-19"},{"v":219}]},{"c":[{"v":"2012-01-20"},{"v":207}]},{"c":[{"v":"2012-01-21"},{"v":196}]},{"c":[{"v":"2012-01-22"},{"v":213}]},{"c":[{"v":"2012-01-23"},{"v":209}]},{"c":[{"v":"2012-01-24"},{"v":215}]},{"c":[{"v":"2012-01-25"},{"v":205}]},{"c":[{"v":"2012-01-26"},{"v":211}]},{"c":[{"v":"2012-01-27"},{"v":205}]},{"c":[{"v":"2012-01-28"},{"v":201}]},{"c":[{"v":"2012-01-29"},{"v":205}]},{"c":[{"v":"2012-01-30"},{"v":212}]},{"c":[{"v":"2012-01-31"},{"v":204}]},{"c":[{"v":"2012-02-01"},{"v":209}]},{"c":[{"v":"2012-02-02"},{"v":202}]},{"c":[{"v":"2012-02-03"},{"v":215}]},{"c":[{"v":"2012-02-04"},{"v":214}]},{"c":[{"v":"2012-02-05"},{"v":187}]},{"c":[{"v":"2012-02-06"},{"v":203}]},{"c":[{"v":"2012-02-07"},{"v":211}]},{"c":[{"v":"2012-02-08"},{"v":216}]},{"c":[{"v":"2012-02-09"},{"v":206}]},{"c":[{"v":"2012-02-10"},{"v":209}]},{"c":[{"v":"2012-02-11"},{"v":195}]},{"c":[{"v":"2012-02-12"},{"v":199}]},{"c":[{"v":"2012-02-13"},{"v":217}]},{"c":[{"v":"2012-02-14"},{"v":209}]},{"c":[{"v":"2012-02-15"},{"v":214}]},{"c":[{"v":"2012-02-16"},{"v":219}]},{"c":[{"v":"2012-02-17"},{"v":219}]},{"c":[{"v":"2012-02-18"},{"v":216}]},{"c":[{"v":"2012-02-19"},{"v":213}]},{"c":[{"v":"2012-02-20"},{"v":204}]},{"c":[{"v":"2012-02-21"},{"v":199}]},{"c":[{"v":"2012-02-22"},{"v":204}]},{"c":[{"v":"2012-02-23"},{"v":195}]},{"c":[{"v":"2012-02-24"},{"v":190}]},{"c":[{"v":"2012-02-25"},{"v":199}]},{"c":[{"v":"2012-02-26"},{"v":211}]},{"c":[{"v":"2012-02-27"},{"v":193}]},{"c":[{"v":"2012-02-28"},{"v":198}]},{"c":[{"v":"2012-02-29"},{"v":202}]},{"c":[{"v":"2012-03-01"},{"v":202}]},{"c":[{"v":"2012-03-02"},{"v":199}]},{"c":[{"v":"2012-03-03"},{"v":223}]},{"c":[{"v":"2012-03-04"},{"v":183}]},{"c":[{"v":"2012-03-05"},{"v":204}]},{"c":[{"v":"2012-03-06"},{"v":204}]},{"c":[{"v":"2012-03-07"},{"v":211}]},{"c":[{"v":"2012-03-08"},{"v":213}]},{"c":[{"v":"2012-03-09"},{"v":194}]},{"c":[{"v":"2012-03-10"},{"v":215}]},{"c":[{"v":"2012-03-11"},{"v":201}]},{"c":[{"v":"2012-03-12"},{"v":211}]},{"c":[{"v":"2012-03-13"},{"v":218}]},{"c":[{"v":"2012-03-14"},{"v":212}]},{"c":[{"v":"2012-03-15"},{"v":210}]},{"c":[{"v":"2012-03-16"},{"v":0}]}]});
>
>
>
>
> On Thursday, June 25, 2015 at 9:56:10 AM UTC-4, Daniel LaLiberte wrote:
>>
>> Zub zeb,
>>
>> Does your DataTable have one column for each of your series?   Can you
>> give an example of what your data looks like, perhaps in the form of an
>> array of arrays that you could pass to arrayToDataTable?
>>
>>
>> On Wed, Jun 24, 2015 at 5:42 PM, zub zeb  wrote:
>>
>>> I'm pretty sure I'm supposed to be using the series function for this,
>>> but whenever I try, I get only the first color of the

Re: [visualization-api] Different color for each day of the week for a column chart?

2015-06-25 Thread zub zeb
Hi Daniel,

Below is a sample of what I'm pulling when I view source.  I can see where 
I might be going wrong now though being that I have the date formatted as a 
string though.  I tried to switch it to date format, but it caused the 
chart to fail.  I'm trying to sort out that issue now too.  I'm guessing 
the charts are pretty picky about the format in which they receive their 
date values from mySQL.  I'm reading up on that now too and trying to use 
the information in this thread to sort it out: 
 http://stackoverflow.com/questions/24929767/mysql-datetime-in-google-chart 

Anywho...  I would appreciate any direction on this one.  If you have a 
better source, I sure don't mind reading up on how to sort this out. 
 Thanks.

var data = new 
google.visualization.DataTable({"cols":[{"label":"Date","type":"string"},{"label":"Daily
 
Usage","type":"number"}],"rows":[{"c":[{"v":"2012-01-01"},{"v":153}]},{"c":[{"v":"2012-01-02"},{"v":160}]},{"c":[{"v":"2012-01-03"},{"v":179}]},{"c":[{"v":"2012-01-04"},{"v":171}]},{"c":[{"v":"2012-01-05"},{"v":169}]},{"c":[{"v":"2012-01-06"},{"v":196}]},{"c":[{"v":"2012-01-07"},{"v":205}]},{"c":[{"v":"2012-01-08"},{"v":196}]},{"c":[{"v":"2012-01-09"},{"v":202}]},{"c":[{"v":"2012-01-10"},{"v":213}]},{"c":[{"v":"2012-01-11"},{"v":189}]},{"c":[{"v":"2012-01-12"},{"v":214}]},{"c":[{"v":"2012-01-13"},{"v":193}]},{"c":[{"v":"2012-01-14"},{"v":185}]},{"c":[{"v":"2012-01-15"},{"v":204}]},{"c":[{"v":"2012-01-16"},{"v":206}]},{"c":[{"v":"2012-01-17"},{"v":209}]},{"c":[{"v":"2012-01-18"},{"v":212}]},{"c":[{"v":"2012-01-19"},{"v":219}]},{"c":[{"v":"2012-01-20"},{"v":207}]},{"c":[{"v":"2012-01-21"},{"v":196}]},{"c":[{"v":"2012-01-22"},{"v":213}]},{"c":[{"v":"2012-01-23"},{"v":209}]},{"c":[{"v":"2012-01-24"},{"v":215}]},{"c":[{"v":"2012-01-25"},{"v":205}]},{"c":[{"v":"2012-01-26"},{"v":211}]},{"c":[{"v":"2012-01-27"},{"v":205}]},{"c":[{"v":"2012-01-28"},{"v":201}]},{"c":[{"v":"2012-01-29"},{"v":205}]},{"c":[{"v":"2012-01-30"},{"v":212}]},{"c":[{"v":"2012-01-31"},{"v":204}]},{"c":[{"v":"2012-02-01"},{"v":209}]},{"c":[{"v":"2012-02-02"},{"v":202}]},{"c":[{"v":"2012-02-03"},{"v":215}]},{"c":[{"v":"2012-02-04"},{"v":214}]},{"c":[{"v":"2012-02-05"},{"v":187}]},{"c":[{"v":"2012-02-06"},{"v":203}]},{"c":[{"v":"2012-02-07"},{"v":211}]},{"c":[{"v":"2012-02-08"},{"v":216}]},{"c":[{"v":"2012-02-09"},{"v":206}]},{"c":[{"v":"2012-02-10"},{"v":209}]},{"c":[{"v":"2012-02-11"},{"v":195}]},{"c":[{"v":"2012-02-12"},{"v":199}]},{"c":[{"v":"2012-02-13"},{"v":217}]},{"c":[{"v":"2012-02-14"},{"v":209}]},{"c":[{"v":"2012-02-15"},{"v":214}]},{"c":[{"v":"2012-02-16"},{"v":219}]},{"c":[{"v":"2012-02-17"},{"v":219}]},{"c":[{"v":"2012-02-18"},{"v":216}]},{"c":[{"v":"2012-02-19"},{"v":213}]},{"c":[{"v":"2012-02-20"},{"v":204}]},{"c":[{"v":"2012-02-21"},{"v":199}]},{"c":[{"v":"2012-02-22"},{"v":204}]},{"c":[{"v":"2012-02-23"},{"v":195}]},{"c":[{"v":"2012-02-24"},{"v":190}]},{"c":[{"v":"2012-02-25"},{"v":199}]},{"c":[{"v":"2012-02-26"},{"v":211}]},{"c":[{"v":"2012-02-27"},{"v":193}]},{"c":[{"v":"2012-02-28"},{"v":198}]},{"c":[{"v":"2012-02-29"},{"v":202}]},{"c":[{"v":"2012-03-01"},{"v":202}]},{"c":[{"v":"2012-03-02"},{"v":199}]},{"c":[{"v":"2012-03-03"},{"v":223}]},{"c":[{"v":"2012-03-04"},{"v":183}]},{"c":[{"v":"2012-03-05"},{"v":204}]},{"c":[{"v":"2012-03-06"},{"v":204}]},{"c":[{"v":"2012-03-07"},{"v":211}]},{"c":[{"v":"2012-03-08"},{"v":213}]},{"c":[{"v":"2012-03-09"},{"v":194}]},{"c":[{"v":"2012-03-10"},{"v":215}]},{"c":[{"v":"2012-03-11"},{"v":201}]},{"c":[{"v":"2012-03-12"},{"v":211}]},{"c":[{"v":"2012-03-13"},{"v":218}]},{"c":[{"v":"2012-03-14"},{"v":212}]},{"c":[{"v":"2012-03-15"},{"v":210}]},{"c":[{"v":"2012-03-16"},{"v":0}]}]});




On Thursday, June 25, 2015 at 9:56:10 AM UTC-4, Daniel LaLiberte wrote:
>
> Zub zeb,
>
> Does your DataTable have one column for each of your series?   Can you 
> give an example of what your data looks like, perhaps in the form of an 
> array of arrays that you could pass to arrayToDataTable?
>
>
> On Wed, Jun 24, 2015 at 5:42 PM, zub zeb  > wrote:
>
>> I'm pretty sure I'm supposed to be using the series function for this, 
>> but whenever I try, I get only the first color of the series to display.   
>> The way it's set up now is that it pulls hourly timestamped data from a 
>> mySQL database from one column and then displays the totals of another 
>> column for that 24 hour period. The user can then select the period they 
>> want to view data for in order to view a column chart that covers days, 
>> weeks, months, or even years of data at a time.  Chart looks great, but all 
>> the days are the same color, and I would like to be able to have the user 
>> identify which days are the weekends.
>>
>> Can anybody point me in the right direction for achieving this?  Like I 
>> said, I know I'm supposed to be using a series in order to achieve this, 
>> but haven't had much success.
>>
>> I figured something like this should be what I want but like I said, I 
>> only see the first co

Re: [visualization-api] Stacked chart with sum total annotation

2015-06-25 Thread 'Daniel LaLiberte' via Google Visualization API
Hi Kevin,

There is no built-in option to display a sum, but you can add a series with
a 0 value, and give it an annotation that shows the sum.

This is a frequent enough request that we should probably add an option to
support it.

On Thu, Jun 25, 2015 at 8:14 AM, Kevin Tucker 
wrote:

> Hi there.
>
> Is there a way to add an annotation to the top of stacked charts so that I
> can display the sum total of the values of the stack parts?
>
> Thanks,
> Kevin
>
> --
> 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.
>



-- 
Daniel LaLiberte   -
978-394-1058
dlalibe...@google.com5CC, Cambridge MA
daniel.lalibe...@gmail.com  9 Juniper Ridge
Road, Acton MA

-- 
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: Vertical Marker on Line Chart

2015-06-25 Thread Richard Hammitt
You may consider the use of error bars.  I carried this trick over from 
Excel.  

1) Add another column to your chart in Advanced Edit, Recommendations, Data 
Range.  
2) Add a number to a cell in that column within your Y-axis range 
corresponding to the location of your vertical line. 
3) In Advanced Edit, Customization, Series, pick your newly created column. 
  You can add an error bar for the cell you chose in 2) by going to the 
Error Bars and selecting Constant from the Error Bar drop down menu.
4) Extend the error bar as high and low as you want.  You can fix the 
Y-Axis range if your error range raises or lowers the chart Y range.

I hope this helps!

On Wednesday, May 16, 2012 at 9:50:42 AM UTC-5, Jim wrote:
>
> Is it possible to add a vertical marker for a line / area chart?  For 
> example, say my x-axis range is 0-50 and I want to show a vertical 
> line at 33.  Is that possible?  I couldn't find this in the 
> documentation.


-- 
This message and any files transmitted with it are the property of 
Sigma-Aldrich Corporation, are confidential, and are intended solely for 
the use of the person or entity to whom this e-mail is addressed. If you 
are not one of the named recipient(s) or otherwise have reason to believe 
that you have received this message in error, please contact the sender and 
delete this message immediately from your computer. Any other use, 
retention, dissemination, forwarding, printing, or copying of this e-mail 
is strictly prohibited.

-- 
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] Different color for each day of the week for a column chart?

2015-06-25 Thread 'Daniel LaLiberte' via Google Visualization API
Zub zeb,

Does your DataTable have one column for each of your series?   Can you give
an example of what your data looks like, perhaps in the form of an array of
arrays that you could pass to arrayToDataTable?


On Wed, Jun 24, 2015 at 5:42 PM, zub zeb  wrote:

> I'm pretty sure I'm supposed to be using the series function for this, but
> whenever I try, I get only the first color of the series to display.   The
> way it's set up now is that it pulls hourly timestamped data from a mySQL
> database from one column and then displays the totals of another column for
> that 24 hour period. The user can then select the period they want to view
> data for in order to view a column chart that covers days, weeks, months,
> or even years of data at a time.  Chart looks great, but all the days are
> the same color, and I would like to be able to have the user identify which
> days are the weekends.
>
> Can anybody point me in the right direction for achieving this?  Like I
> said, I know I'm supposed to be using a series in order to achieve this,
> but haven't had much success.
>
> I figured something like this should be what I want but like I said, I
> only see the first color for ALL the columns:
>
> series: {
> 0: { color: '#99FF66' },
> 1: { color: '#99FF66' },
> 2: { color: '#f1ca3a' },
> 3: { color: '#6f9654' },
> 4: { color: '#1c91c0' },
> 5: { color: '#43459d' },
> 6: { color: '#e7711b' },
>  },
>
>
>
>  --
> 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.
>



-- 
Daniel LaLiberte   -
978-394-1058
dlalibe...@google.com5CC, Cambridge MA
daniel.lalibe...@gmail.com  9 Juniper Ridge
Road, Acton MA

-- 
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] Stacked column chart

2015-06-25 Thread 'Daniel LaLiberte' via Google Visualization API
Actually, using a DataView is probably not going to help as much as I
thought.  What you'll probably need to do is this:

   1. Get the distinct values in the keywords and clients, using
   getDistinctValues(columnIndex).
   2. Set up an empty Object that will map from each keyword to the row
   index for that keyword.
   3. Set up another Object to map from each client to the column index for
   that client.
   4. Create an empty DataTable.
   5. Iterate through your rows of data, and as you encounter a keyword
   that is not in your map, add a new row to the data table, and add to the
   Object map.  Either way, you have the row index.
   6. Similarly, for each client, add it to the map if it is not there, and
   add a column to the data table..
   7. Given the row and column index, you can do setValue() with the data.

Everything that is not set will be undefined, and should be treated like
null.

Hope that helps.  Not exactly trivial, and all the more reason we should
provide some helper utilities to make this easier for people.




On Wed, Jun 24, 2015 at 5:31 PM, SANTHOSH THANGARAJ <
santhoshthangar...@gmail.com> wrote:

> Hi Daniel,
>
> Thanks a lot. I will try to use DataView.
>
> Best Regards
> Santhosh
>
>>   --
> 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.
>



-- 
Daniel LaLiberte   -
978-394-1058
dlalibe...@google.com5CC, Cambridge MA
daniel.lalibe...@gmail.com  9 Juniper Ridge
Road, Acton MA

-- 
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] Geocharts explorer option (zoom)

2015-06-25 Thread 'Sergey Grabkovsky' via Google Visualization API
GeoCharts don't support the explorer options.
On Thu, Jun 25, 2015 at 5:40 AM  wrote:

> Hi,
>
> Can someone give me an exmaple of a geochart using the explorer option
> that allows to pan and zoom?
>
> I set the option but I can't make it work
>
> Thk!
>
> --
> 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] Stacked chart with sum total annotation

2015-06-25 Thread Kevin Tucker
Hi there.

Is there a way to add an annotation to the top of stacked charts so that I 
can display the sum total of the values of the stack parts?

Thanks,
Kevin

-- 
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] Gauge - Options

2015-06-25 Thread Simon Tomek
Hello everyone,
I have a funny question. :)
Is it possible to use different options for different Gauges in on Draw 
cycle?

If you look here:
https://portals.exosite.com/views/3504609913/1323713614
there are 8 Gauges in 8 containers.
The problem is (well, it is not a problem, it is a security measure) each 
one Custom Widget asks to "Execute the Javascript", which is pretty 
annoying.
So, the only way how to make it not so annoying is to group together more 
Gauges (into one container).
And I am thinking of using more *Draw options* in one container.

*Here is a little piece of the code:*
var i;
var output = [];
for( i = 0; i < resources.length; i++ ) {
output = [];
output[i][0] = String('Index: ' + i);
output[i][1] = i;
}
var chart = new google.visualization.Gauge( container );
var data = new google.visualization.DataTable();
var options = { min: 0, max: 100, ..some options setting.. };
data.addColumn('string', 'Label');
data.addColumn('number', 'Value');
data.addRows( output );
chart.draw( data, options );

There are attached some *.js files.

-- 
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] Geocharts explorer option (zoom)

2015-06-25 Thread donkey . kong . elite
Hi,
 
Can someone give me an exmaple of a geochart using the explorer option that 
allows to pan and zoom?
 
I set the option but I can't make it work
 
Thk!

-- 
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] IE11 HTML 1512 Warning with google.load

2015-06-25 Thread Gard Olsen


https://www.google.com/jsapi";>



   // Load the Visualization API
   google.load('visualization', '1.1', {packages: ['corechart', 'table'], 
language: 'no'});


I am at a loss how to deal with this problem so I try this group for 
answers. 




The warning I get is: 

HTML1512

"Unmatched end tag."
More on HTML Error Codes in IE: 
https://msdn.microsoft.com/en-us/library/hh180764(v=vs.85).aspx

I've also tried to autoload it but the same happens.

https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart',
 'table'],'language':'no'}]}">



Any feedback would do. 

Others with similar issues:
http://stackoverflow.com/questions/26027821/why-does-google-visualization-cause-html1504-unexpected-end-tag-errors
http://stackoverflow.com/questions/28432708/internet-explorer-markup-errors-when-using-google-feed-api-in-master-page

Best regards,
Gard Olsen

-- 
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.