Well how are you suppose to process if you want to have diffferent color representing different datasetvalue...
It should be simple but it isn't maybe I should process differently ? Anyone having an idea ? On Jun 9, 12:26 pm, Firekissed <[email protected]> wrote: > Hi this is my code : > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" / > > <link rel="stylesheet" media="screen" type="text/css" href="css/ > style.css" /> > <script type="text/javascript" src="http://www.google.com/jsapi"></ > script> > <script type="text/javascript"> > google.load("visualization", "1", {packages:["corechart"]}); > google.setOnLoadCallback(drawChart); > function drawChart() { > <?php > include 'include/bdd.php'; > $recup2 = mysql_query("SELECT posx,posy FROM elfik_user WHERE > race='demon'") or die(mysql_error()); > $num_row = mysql_num_rows($recup2); > $recup3 = mysql_query("SELECT posx,posy FROM elfik_user WHERE > race='ange'") or die(mysql_error()); > $num_row2 = mysql_num_rows($recup3); > $num = $num_row + $num_row2; > $I=0;?> > var data = new google.visualization.DataTable(); > data.addColumn('number', 'Abscisses'); > data.addColumn('number', 'Hommes'); > data.addColumn('number', 'Elfes'); > > data.addRows(<?php echo $num;?>); > > <?php > while($fetch2 = mysql_fetch_assoc($recup2)) > { > ?>data.setValue(<?php echo $I;?>, 0, <?php echo $fetch2['posx'];?>); // > first data seriedata.setValue(<?php echo $I;?>, 1, <?php echo > $fetch2['posy'];?>); > <?php > $I++;}; > > ?> > > data.addRows(<?php echo $num;?>); > > <?php > while($fetch3 = mysql_fetch_assoc($recup3)) > { > ?>data.setValue(<?php echo $I;?>, 0, <?php echo $fetch3['posx'];?>); // > second data seriedata.setValue(<?php echo $I;?>, 1, <?php echo > $fetch3['posy'];?>); > <?php > > $I++;}; > > ?> > > var formatter = new > google.visualization.TableColorFormat(); > formatter.addRange(-50, 'orange'); > formatter.addRange(50, 'red'); > formatter.format(data, 0); // Apply formatter to second column > var chart = new > google.visualization.ScatterChart(document.getElementById('chart_div')); > chart.draw(data, {width: 1300, height: 1000, > title: 'carte du monde', > hAxis: {title: 'Abscisses', minValue: -200, > maxValue: 200}, > vAxis: {title: 'Ordonnées', minValue: -200, > maxValue: 200}, > legend: 'none', > pointSize : '3', > //colors: ['red','blue'] > }); > } > > </script> > </head> > <body> > <SCRIPT LANGUAGE="JavaScript" SRC="script/menu.js"></SCRIPT> > <div id="chart_div"></div> > </body> > </html> > > And I would like to make the first data serie (please refer to the > comments in the code) create red points, and the second one create > blue points. Is there any way to make it possible ? -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. 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.
