problem with 'tooltip.text':'percent'

140 views
Skip to first unread message

alex pavel

unread,
Jan 6, 2012, 10:45:38 AM1/6/12
to Google Visualization API
I set :

function drawChart1() {

// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
['Excelenta', <?=$tip3?>],
['Buna', <?=$tip2?>],
['Slaba', <?=$tip1?>]
]);

// Set chart options
var options = {'tooltip.text':'percent',
'title':'Cum a fost calatoria dumneavoastra cu <?php echo
ucfirst($compania);?>?',
'width':650,
'height':300,
};

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

but in render I see tooltip.text both.
What is the problem?
Thanks

Roni Biran

unread,
Jan 6, 2012, 10:49:43 AM1/6/12
to google-visua...@googlegroups.com
Your problem is with the syntax. The tooltip.text stands for "tooltip: { text: 'percent' }"
this is what you need to place inside your options instead of what you wrote.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

asgallant

unread,
Jan 6, 2012, 11:24:42 AM1/6/12
to google-visua...@googlegroups.com
It should be 'percentage' too, not 'percent':

var options {
    tooltip{
        text'percentage'
Reply all
Reply to author
Forward
0 new messages