Hi asgallant,
*I was reading this and trying to configure to my application.*
*Let me tell you what i have being trying.*
*Can we send multiple queried data into a single chart.*
*Assume:*
*There can be multiple users.They can work 8 hours per day.*
*User1=*
*Development time: 5hrs*
*Issue fixing time:3 hrs*
*
*
*User2*
*Development time:8hrs*
*Issue fixing time:0 hrs*
*
*
*User3*
*Development time:2hrs*
*Issue fixing time:6 hrs*
* *
*So can i display these data in the same column chart.So there will be 6
columns.1st,3rd and 5th columns will be in common color, while rest will be
in a different color.*
*please help me with this.*
*waiting for your quick reply*
*thanks in advance
*
On Thursday, December 6, 2012 12:16:00 PM UTC+5:30, asgallant wrote:
>
> Ok, here's example PHP to get you started:
>
> <?php
> /* $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);
>
> // return the JSON data
> echo $jsonTable;
> ?>
>
> You will have to fill in the database connection information, write your
> SQL query, define the columns in $table['cols'], and adjust the while loop
> to ensure that all columns of data get populated. You should be able to
> navigate to that page in your browser and see a string of JSON data. When
> you have a basic version running, I'll help you hook it up to your chart(s).
>
> On Wednesday, December 5, 2012 10:54:01 PM UTC-5, Chrystopher Medina wrote:
>>
>> hi my frined thanks for answering me my question. could you be more
>> expecific u know i really dont know speak english very well. and i just
>> began to study this about how to program whit ajax .... really its posible
>> .... could u help me my friend could u give me ur email or ur facebook
>> page. or something like that. ....... its very important to me to do this.
>> i ve spend months with this work. and it doesnt work ....... please
>> explaime how i can do in order to achieve this ............
>>
>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/aCutHXQyr-sJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.