
Hi, I use JQuery an Ajax to compose Scatter Graph, most of times its show anormal, only few times looks well.
Other thing Material Scatter not format percents.
Whats happend?
Thanks for help!
There is my code:
$.ajax({
type: "GET",
url: $("#frm").attr('action'),
data: 'acc=des&plt=' + plt + '&crr=' + crr + '&gen=' + gen + '&ran=' + index,
dataType: "json",
success: function(JSONData){
$("#TabularDesglose").html(JSONData.html);
// ScatterChart3
var data = google.visualization.arrayToDataTable(JSONData.cap);
var formatter = new google.visualization.NumberFormat({pattern: '#.##%'});
formatter.format(data, 1); // format column 2
formatter.format(data, 2); // format column 3
var options = {
chart: {
title: 'Desglose',
subtitle: 'Avance / Promedio'
},
width: 800,
height: 400,
isStacked: true,
fill: 20,
displayExactValues: false,
hAxis: {title: 'Ciclos', minValue: 1, maxValue: 10, showTextEvery:1, format: '#'},
vAxis: [{title: 'Créditos', minValue: 0, maxValue: 1, format: 'percent'},
{title: 'Asignaturas', minValue: 0, maxValue: 1, format: 'percent'},
{title: 'Promedio', minValue: 0, maxValue: 10, format: '#'}
],
series: {
0: {axis: 'Créditos'},
1: {axis: 'Asignaturas'},
2: {axis: 'Promedio'}
},
axes: {
y: {
'Creditos': {label: 'Avance'},
'Asignaturas': {label: 'Avance'},
'Promedio': {label: 'Promedio'}
},
x: {
'Ciclos': {label: 'Ciclos'}
}
}
};
var chart = new google.charts.Scatter(document.getElementById('ScatterChart3'));
chart.draw(data, google.charts.Scatter.convertOptions(options));
$("#filter-box2").val('').unbind();
$("#tableFilter2").tablesorter({
widthFixed: false,
widgets: ["filter"],
dateFormat: "ddmmyyyy",
cssInfoBlock: "tablesorter-no-sort",
sortList: [[0]],
widgetOptions: {
filter_columnFilters: false,
filter_saveFilters: true,
resizable: false,
filter_external: '.search'
},
headers: {
0: { sorter: true },
1: { sorter: true },
2: { sorter: false },
3: { sorter: false },
4: { sorter: false },
5: { sorter: false },
6: { sorter: false },
7: { sorter: false },
8: { sorter: false },
9: { sorter: false },
10: { sorter: false },
11: { sorter: false }
}
});
}
});
}