Quantcast
Channel: Topics in Category: Can I do this with LimeSurvey? - LimeSurvey forums
Viewing all articles
Browse latest Browse all 17529

Two google graphs in one question group? - by: Marieke123

$
0
0
Below you can find the code I used for two questions in one question group (I also want to use the expression manager to insert weights from previous questions, but I can also recall the problem without using them). I have also attached the limesurvey-group file (Dutch language). I have also tried this solution, but it did not work (or perhaps I coded something wrong). stackoverflow.com/questions/9888920/how-...arts-on-the-one-page

File Attachment:

File Name: twographs_onequestiongroup.lsg
File Size: 7 KB


Question 1:
<script type="text/javascript" src=" www.google.com/jsapi "></script><script type="text/javascript">
// binnen de script tags is elke regel die begint met // een commentaar.


google.load('visualization', '1', { 'packages': } );


google.setOnLoadCallback(drawChart);

function drawChart() {


var data = google.visualization.arrayToDataTable([
,
,
,
,

]);

var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{ calc: function(dt, rowIndex) { return dt.getValue(rowIndex, 1).toString() + '%' },
sourceColumn: 1,
type: "string",
role: "annotation" },
2]);



// Set chart options

var options = {
width: 800,
height: 600,
title: 'Hoe belangrijk vindt u elk kenmerk (in percentages uitgedrukt)',
vAxis: { format: '#\'%\'', maxValue: '100', minValue: '0'},
legend: { position: 'none'},
bar: { groupWidth: '75%' },
};


// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.ColumnChart(document.getElementById("columnchart_values"));
chart.draw(view, options);
}
</script>
<p>
</p>
<div id="columnchart_values" style="width: 800px; height: 600px;">
</div>


Question 2:
script type="text/javascript" src=" www.google.com/jsapi "></script><script type="text/javascript">
// binnen de script tags is elke regel die begint met // een commentaar.


google.load('visualization', '1', { 'packages': } );


google.setOnLoadCallback(drawChart);

function drawChart() {


var data = google.visualization.arrayToDataTable([
,
,
,
,

]);

var view = new google.visualization.DataView(data);
view.setColumns([0, 1,
{ calc: function(dt, rowIndex) { return dt.getValue(rowIndex, 1).toString() + '%' },
sourceColumn: 1,
type: "string",
role: "annotation" },
2]);

// Set chart options

var options = {
width: 800,
height: 600,
title: 'Hoe belangrijk vindt u elk kenmerk (in percentages uitgedrukt)',
vAxis: { format: '#\'%\'', maxValue: '100', minValue: '0'},
legend: { position: 'none'},
bar: { groupWidth: '75%' },
};


// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.ColumnChart(document.getElementById("columnchart_values"));
chart.draw(view, options);
}
</script>
<p>
</p>
<div id="columnchart_values" style="width: 800px; height: 600px;">
</div>

Viewing all articles
Browse latest Browse all 17529

Trending Articles