|
Exécution de BAR CHART de google sur WDM18 ? |
Started by Testeur, Jun., 17 2015 7:56 PM - 2 replies |
| |
| | | |
|
| |
Posted on June, 17 2015 - 7:56 PM |
Bonjour,
J'ai collé le code suivant du google dans la description d'un champ HTML avec WDM18 :
<html> <head> <! <script type="text/javascript" src="https://www.google.com/jsapi"></script> <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', 'Topping'); Data.AddColumn('number', 'Slices'); Data.addRows([ ['Mushrooms', 3], ['Onions', 1], ['Olives', 1], ['Zucchini', 1], ['Pepperoni', 2] ]);
var options = {'title':'How Much Pizza I Ate Last Night', 'width':400, 'height':300};
var chart = new google.visualization.PieChart(document.getElementById('chart_div')); chart.draw(Data, options); } </script> </head>
<body> <! <div id="chart_div"></div> </body> </html>
Je ne sais pas jusqu’à maintenant pourquoi ça marche pas ? |
| |
| |
| | | |
|
| | |
| |
Posted on June, 17 2015 - 10:43 PM |
Bonjour
Sans doute parce que tu colle le code d'une PAGE COMPLETE à l'intérieur d'un CHAMP... Il ne peut y avoir qu'un seul tag html par page, un seul tag head par page, etc...
Cordialement
-- Fabrice Harari Consultant WinDev, WebDev et WinDev Mobile International
Disponible : WXShowroom.com, WXReplication (open source) Bientôt : WXEDM (open source) Plus d'information sur http://fabriceharari.com
On 6/17/2015 11:56 AM, Testeur wrote:
Bonjour, J'ai collé le code suivant du google dans la description d'un champ HTML avec WDM18 : <html> <head> <! <script type="text/javascript" src="https://www.google.com/jsapi"></script> <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', 'Topping'); data.addColumn('number', 'Slices'); data.addRows([ ['Mushrooms', 3], ['Onions', 1], ['Olives', 1], ['Zucchini', 1], ['Pepperoni', 2] ]);
var options = {'title':'How Much Pizza I Ate Last Night', 'width':400, 'height':300};
var chart = new google.visualization.PieChart(document.getElementById('chart_div')); chart.draw(data, options); } </script> </head>
<body> <! <div id="chart_div"></div> </body> </html> Je ne sais pas jusqu’à maintenant pourquoi ça marche pas ? |
| |
| |
| | | |
|
| | |
| |
Posted on June, 18 2015 - 11:58 AM |
Bonjour, J'ai met dans le code du HTML le code suivant en mettant le code script dans un fichier javasciprt:
<script type="text/javascript" src="jsapi.js"></script>
<div id="chart_div"></div>
mais toujours ça ne marche pas ? |
| |
| |
| | | |
|
| | | | |
| | |
|