You are using java, right?  If so, the you can use the API I linked above 
to hook into your database and handle the queries.  You use a SQL-like 
language in javascript to query the data source API.  None of this requires 
any changes to your database, nor does it require PHP.

On the javascript end of things, the Visualization API takes the data 
returned by the query and inputs it into a DataTable object (which is the 
data structure required by the charts).  There isn't any way to plug the 
charts directly into your MySQL database if that is what you were hoping 
for.

On Tuesday, June 18, 2013 4:10:23 AM UTC-4, Benjamin Bandali wrote:
>
> But I have used SQL, and this doesent seem to work with it? I mean it 
> implements a new data table, I wanna use the exisiting one that I created 
> in mySQL and intregate it with Google Charts. Are there any ways? Without 
> php.
>
> Den måndagen den 17:e juni 2013 kl. 18:29:24 UTC+2 skrev asgallant:
>>
>> There is a Java datasource library that might be helpful for you: 
>> https://developers.google.com/chart/interactive/docs/dev/dsl_intro.  It 
>> implements the SQL-like Query API for fetching data for a visualization.
>>
>> On Monday, June 17, 2013 8:47:28 AM UTC-4, Benjamin Bandali wrote:
>>>
>>> I have this database with this table that I want to put in on my .jsp 
>>> page that I coded in basic HTML. The project is in Spring mvc.
>>>
>>> CREATE TABLE `status` (
>>>>   `idStatus` int(11) NOT NULL AUTO_INCREMENT,
>>>>   `timeStamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
>>>>   `value` varchar(45) NOT NULL,
>>>>   `unit` varchar(45) NOT NULL,
>>>>   `idCategory` int(11) NOT NULL,
>>>>   PRIMARY KEY (`idStatus`),
>>>>   UNIQUE KEY `idStatus_UNIQUE` (`idStatus`),
>>>>   KEY `timeStampIndex` (`timeStamp`),
>>>>   KEY `statusTocategory_idx` (`idCategory`),
>>>>   CONSTRAINT `statusTocategory` FOREIGN KEY (`idCategory`) REFERENCES 
>>>> `category` (`idCategory`) ON DELETE NO ACTION ON UPDATE NO ACTION
>>>>>
>>>>> ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8$$
>>>>
>>>>
>>> So far I can get the basic google line chart on the webpage, but not 
>>> with the values. I want it o show the Value based on time.
>>> This is the code I have so far:
>>>
>>> <head>
>>> <script type="text/javascript" 
>>> src="https://www.google.com/jsapi";></script><script type="text/javascript">
>>>     google.load("visualization", "1", {
>>>         packages : [ "corechart" ]
>>>     });
>>>     google.setOnLoadCallback(drawChart);
>>>     function drawChart(serverData) {
>>>
>>>         var serverData = [ [ 'Year', 'Sales', 'Expenses' ],
>>>                 [ '2004', 1000, 400 ], [ '2005', 1170, 460 ],
>>>                 [ '2006', 660, 1120 ], [ '2007', 1030, 540 ] ];
>>>         var data = google.visualization.arrayToDataTable(serverData);
>>>
>>>         var options = {
>>>             title : 'Company Performance'
>>>         };
>>>
>>>         var chart = new google.visualization.LineChart(document
>>>                 .getElementById('chart_div'));
>>>         chart.draw(data, options);
>>>     }</script>
>>> </head>  
>>>
>>>
>>>
>>> How can I replace the Serverdata inputs with Value over time? (I don't have 
>>> any knowledge in php) The google code is in javascript, but does it work to 
>>> merge it with pure java or php code? Please help!
>>>
>>>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to