You're putting the same data in both columns, and if you are still using 
the line:

var varjs="'.$variable_php.'";

then you are setting the variable as a string and putting it into a column 
that should have a number (the second column in the array).  If you had two 
variables it would look like this:

[varjs1, varjs2, 400], 

On Thursday, May 24, 2012 2:58:08 PM UTC-4, Ro wrote:
>
> thanks for the help, but it still does not work i have tried :
>
>  [varjs,  {v:varjs},      400], 
>
> and
>
>  [varjs,  {varjs},      400], 
>
>
>
> 2012/5/24 IL MOSTRO <[email protected]>
>
>> hi this is ma code and it does not work
>> please help
>>
>> <?php
>> $variable_php=1;
>>
>> echo '<html>
>>   <head>
>>   
>>     <script type="text/javascript" src="https://www.google.com/jsapi
>> "></script>
>>     <script type="text/javascript">
>>  var varjs="'.$variable_php.'";
>>       google.load("visualization", "1", {packages:["corechart"]});
>>       google.setOnLoadCallback(drawChart);
>>       function drawChart() {
>>         var data = google.visualization.arrayToDataTable([
>>           [\'Year\', \'Sales\', \'Expenses\'],
>>           [varjs,  v:varjs,      400],
>>           [\'2005\',  1170,      460],
>>           [\'2006\',  660,       1120],
>>           [\'2007\',  1030,      540]
>>          ]);
>>
>>         var options = {
>>           title: \'Company Performance\',
>>           hAxis: {title: \'Year\', titleTextStyle: {color: \'red\'}}
>>         };
>>
>>         var chart = new 
>> google.visualization.ColumnChart(document.getElementById(\'chart_div\'));
>>         chart.draw(data, options);
>>       }
>>     </script>
>>   </head>
>>   <body>
>>     <div id="chart_div" style="width: 900px; height: 500px;"></div>
>>   </body>
>> </html>'
>> ?>
>>
>
>

-- 
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/-/C21RqApg7FEJ.
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.

Reply via email to