PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV Mobile (versiones precedentes) → Exécution de BAR CHART de google sur WDM18 ?
Exécution de BAR CHART de google sur WDM18 ?
Iniciado por Testeur, 17,jun. 2015 19:56 - 2 respuestas
Publicado el 17,junio 2015 - 19:56
Bonjour,

J'ai collé le code suivant du google dans la description d'un champ HTML avec WDM18 :


<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
FUNCTION drawChart() {

// Create the data table.
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]
]);

// Set chart options
var options = {'title':'How Much Pizza I Ate Last Night',
'width':400,
'height':300};

// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(Data, options);
}
</script>
</head>

<body>
<!--Div that will hold the pie chart-->
<div id="chart_div"></div>
</body>
</html>


Je ne sais pas jusqu’à maintenant pourquoi ça marche pas ?
Publicado el 17,junio 2015 - 22:43
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>
<!--Load the AJAX API-->
<script type="text/javascript"
src="https://www.google.com/jsapi"></script>
<script type="text/javascript">

// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {

// Create the data table.
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]
]);

// Set chart options
var options = {'title':'How Much Pizza I Ate Last Night',
'width':400,
'height':300};

// Instantiate and draw our chart, passing in some options.
var chart = new
google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>

<body>
<!--Div that will hold the pie chart-->
<div id="chart_div"></div>
</body>
</html>


Je ne sais pas jusqu’à maintenant pourquoi ça marche pas ?
Publicado el 18,junio 2015 - 11:58
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 ?