Google Charts Axis Percentage -


https://jsfiddle.net/vko75dg4/

i want have figure % not working me. want rid of time next date when hover on chart.

any ideas? thanks.

<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title> - jsfiddle demo</title>  <script type='text/javascript' src='/js/lib/dummy.js'></script> <link rel="stylesheet" type="text/css" href="/css/result-light.css"> <script type='text/javascript' src="https://www.google.com/jsapi"></script>   <script type='text/javascript'>//<![cdata[   google.load('visualization', '1.1', {packages: ['line']}); google.setonloadcallback(drawchart);  function drawchart() {    var data = new google.visualization.datatable();   data.addcolumn('date', 'date');   data.addcolumn('number', 'test 1');   data.addcolumn('number', 'product 1');   data.addcolumn('number', 'product 2');   data.addcolumn('number', 'product 3');          data.addrows([      [new date(2015, 01, 1),  73, 88, 96, 79],[new date(2015, 02, 1),  100, 75, 86, 90],[new date(2015, 03, 1),  76, 95, 93, 86],[new date(2015, 04, 1),  95, 75, 100, 98],[new date(2015, 05, 1),  91, 31, 88, 85],[new date(2015, 06, 1),  90, 74, 72, 79],[new date(2015, 07, 1),  95, 80, 90, 78],      ]);    var options = {     chart: {       title: 'test',       subtitle: '',     },     width: 1300,     height: 600,     vaxis: { format: 'percent' }      };    var chart = new google.charts.line(document.getelementbyid('linechart_material'));    chart.draw(data, options);   } //]]>    </script>   </head> <body>   <div id="linechart_material"></div>   </body>    </html> 

reading line chart documentation can tell need use chart.draw(data, google.charts.line.convertoptions(options)); in replacement of chart.draw(data, options);.

using % suffix cause unwanted formatting though,it'll mutliply data 100, can divide data 100 first.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -