Hello I want to have a % in my google chart data i have my data like a number but is not accepting % symbol.
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Sales');
data.addRows([
['Line 1', 71.36, 71.36871],
['line 2', 3.07, 74.44134]
]);
var options = {
width: 400, height: 240,
title: 'Company Performance'
};
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, {vAxis: {format:'#,#%'} } );
}
I tried puting the data like
['Line 1', 71.36,'71.36%'],
['line 2', 3.07,'3.07%' ]
]);
Google charts accepts as to give a dictionary with two elements “v” from value and “f” from format.
You can give your values as