I want to show slightly changed text on each google pie chart slice.
In above below you will see we have legends as
work,eat,commute,watch tv,sleep
and we have same text on slices
work,eat,commute,watch tv,sleep
all i want is show different text on each slice e.g.
work-daily,eat-3times,commute-once a day,watch tv-daily,sleep-daily
but legends text should remain as mentioned above.
I don't have option to draw legends outside the chart using jquery.
Any help will be appreciated.
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Task', 'Hours per Day'],
['Work', 11],
['Eat', 2],
['Commute', 2],
['Watch TV', 2],
['Sleep', 7]
]);
var options = {
title: 'My Daily Activities',
pieSliceText: 'label',
};
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data, options);
}
<script type="text/javascript" src="https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization','version':'1.1','packages':['corechart']}]}"></script>
<div id="piechart" style="width: 900px; height: 500px;"></div>