Formatting problem

41 views
Skip to first unread message

Mauricio Rodriguez

unread,
Nov 19, 2015, 8:10:25 PM11/19/15
to Google Visualization API
Hello I have a Material ScatterChart with 3 axes, the format of two percent axes are ok (#,##%),
but for another axis (Promedio) only display one fraction digit when I have 2, round second fraction digit.

Formatter don't work for me.

Thanks in Avance. 



// ScatterChart3

       var data = google.visualization.arrayToDataTable(JSONData.cap);

       var formatter = new google.visualization.NumberFormat({ 
 pattern: '#', 
 fractionDigits: 2
});
formatter.format(data, 2); // format column 3

//console.log(JSONData.cap);

var options = {

chart: {
title: 'Desglose',
subtitle: 'Avance / Promedio'
},
width: 800,
height: 400,
hAxis: {title: 'Ciclos', minValue: 0, maxValue: 10, format: '#', 
viewWindowMode:'explicit',
 viewWindow:{
   min:1,
   max:10
 }
},
vAxes: [{title: 'Avance', minValue: 0, maxValue: 1, format: '#.##%',
viewWindowMode: 'explicit',
 viewWindow: {
   min: 0,
   max: 1
 }
},
//{title: 'Asignaturas', minValue: 0, maxValue: 1, format: '#.##'},
{title: 'Promedio', minValue: 0, maxValue: 10, format: '#.##',
viewWindowMode: 'explicit',
 viewWindow: {
   min: 0,
   max: 1
 }
}
],
series: {
//0: {axis: 'Creditos'},
//1: {axis: 'Asignaturas'},
2: {axis: 'Promedio'}
},
axes: {
           y: {
             'Creditos': {label: 'Avance'},
             'Promedio': {label: 'Promedio'}
           }
}
};

var chart = new google.charts.Scatter(document.getElementById('ScatterChart3'));

chart.draw(data, google.charts.Scatter.convertOptions(options));
Reply all
Reply to author
Forward
0 new messages