Ok lets say that i know the range of data, min and max, in this particular
case, my problem is when the visits are equal to 1. In this case i want the
max to be 2 the min to be 0 and the tick mark equal to 2, that means that
the y axis will show 0 -1 - 2. I unsderstand well the math part of your
answer but i have no idea of how to implement this in my render, i will add
you my code so you can show me how to insert your suggestions, thanks!
<script type="text/javascript">
google.load('visualization', '1.0', {'packages':['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Number');
data.addColumn('number', 'Visits');
<?php
$salida = "";
$fgmembersite->DBLogin();
$result=mysql_query("SELECT country, COUNT(1) as numVisits FROM
".table_stats." WHERE type='profile_visit' AND user_url =
'".$_GET['ref']."' AND id_user='".$_SESSION['user_code']."' GROUP BY
country");
echo "data.addRows([";
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$salida = $salida . "['".$row['country']."', ".$row['numVisits']."],";
}
$salida = rtrim($salida, ",");
echo $salida . "]);";
?>
var options = {'width':300, 'height':300, 'backgroundColor': { fill:
'none' }, 'legend': 'bottom'};
var chart = new
google.visualization.PieChart(document.getElementById('chart_div_country'));
chart.draw(data, options);
}
</script>
--
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/-/b1exMGl3AAwJ.
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.