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>
<body>
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!