Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][JavaScript] Problem Wykres pobieranie wartosci .
robert5555
post
Post #1





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 10.04.2012

Ostrzeżenie: (0%)
-----


  1. <?php
  2. $dod = 50
  3.  
  4. ?>
  5. <html>
  6. <head>
  7. <center>
  8. <!--Load the AJAX API-->
  9. <script type="text/javascript" src="https://www.google.com/jsapi"></script>
  10. <script type="text/javascript">
  11.  
  12. // Load the Visualization API and the piechart package.
  13. google.load('visualization', '1.0', {'packages':['corechart']});
  14.  
  15. // Set a callback to run when the Google Visualization API is loaded.
  16. google.setOnLoadCallback(drawChart);
  17.  
  18. // Callback that creates and populates a data table,
  19. // instantiates the pie chart, passes in the data and
  20. // draws it.
  21. function drawChart() {
  22.  
  23. // Create the data table.
  24. var data = new google.visualization.DataTable();
  25. data.addColumn('string', 'Topping');
  26. data.addColumn('number', 'Slices');
  27. data.addRows([
  28. ['1', <?php $dod ?>],
  29. ['2', 1],
  30. ['3', 1],
  31. ['4', 1],
  32. ]);
  33.  
  34. // Set chart options
  35. var options = {'title':'Statystyki Postaci',
  36. 'width':400,
  37. 'height':300};
  38.  
  39. // Instantiate and draw our chart, passing in some options.
  40. var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
  41. chart.draw(data, options);
  42. }
  43. </script>
  44. </head>


chodzi mi zeby do wartosci
['1', <?php $dod ?>],
['2', 1],
['3', 1],
['4', 1],

w JS pobierało tak jak teraz nie działa ;/
Go to the top of the page
+Quote Post
sowiq
post
Post #2





Grupa: Zarejestrowani
Postów: 1 890
Pomógł: 339
Dołączył: 14.12.2006
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


  1. <?php echo $dod ?>
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.08.2025 - 09:29