I am creating barcharts and my data comes from a database. The code is as
follows:
<?php
echo <<<HEADDATA
<html>
<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() {
var data = google.visualization.arrayToDataTable([
['Department', 'Total Events', 'Successful','Aborted','Rejected'],
HEADDATA;
include "userdata.php";
echo <<<TAILDATA
]);
var options = {
title: '
TAILDATA;
$hos1 = $_GET["hos"];
$userdept = $_GET["dept"];
echo "$hos1 $userdept Department ";
echo <<<TAILDATA2
Cleaning Performance',
vAxis: {title: 'User', titleTextStyle: {color: 'red'}},
colors:['blue','green','orange','red']
};
var chart = new
google.visualization.BarChart(document.getElementById('chart_div'));
<!--Add select handler and see how that works -->
function selectHandler() {
var selectedItem = chart.getSelection()[0];
if (selectedItem) {
var value = data.getValue(selectedItem.row, 0);
TAILDATA2;
echo "var hospital = \"$hos1&dept=$userdept&username=\"";
echo <<<TAILDATA3
;
hospital += value;
<!--var value = data.getValue(selectedItem.row,
selectedItem.column);-->
window.open('http://192.168.0.170/?q=node/4&hos=' +
hospital,'_self',false);
<!--alert('The user selected ' + hospital);-->
}
}
google.visualization.events.addListener(chart, 'select',
selectHandler);
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 900px; height: 1200px;
overflow:auto"></div>
</body>
</html>
TAILDATA3;
?>
The file userdata.php get data for each user, formats it and prints it out.
Everything works fine,
but sometimes the number of users can be large. When the number is large
each entry is squashed
down and becomes unreadable.
What I want to do is set a minimum height for each entry and let the window
auto size with scrollbars.
How do I do this?
Thanks
Paul
--
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/d/optout.