PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WINDEV Mobile (earlier versions) → Exécution de BAR CHART de google sur WDM18 ?
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>
<!--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 ?
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>
<!--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 ?
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 ?