Hello, i would like to know if there's a way to put more than the 5
lines on the y axis on the line graph, put the title of the graph in
the center, and lines around the data displaying part.
Currently the graph show like this:
http://146.83.144.170/huasco/googlevisualizationapi.problem.jpg
But i needed like that:
http://146.83.144.170/huasco/googlevisualizationapi.problem2.jpg
I have used other graph tools like jpgraph, and xml/swf charts and any
of those was so limited like aparently google is, so i hope im wrong
and really just couldn't find the documentation where explain how.
The code of the graph is this:
google.load('visualization', '1', {packages:['corechart']});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('datetime', 'Fecha');
data.addColumn('number', 'Min');
data.addColumn('number', 'Prom');
data.addColumn('number', 'Max');
data.addRows(12);
data.setValue(0, 0, new Date(2011,0,1,00,00,00)); data.setValue(0, 1,
9.61); data.setValue(0, 2, 20.95);data.setValue(0, 3, 33.48);
data.setValue(1, 0, new Date(2011,1,1,00,00,00)); data.setValue(1, 1,
10.18); data.setValue(1, 2, 20.71);data.setValue(1, 3, 32.08);
data.setValue(2, 0, new Date(2011,2,1,00,00,00)); data.setValue(2, 1,
7.23); data.setValue(2, 2, 18.79);data.setValue(2, 3, 32.05);
data.setValue(3, 0, new Date(2011,3,1,00,00,00)); data.setValue(3, 1,
5.59); data.setValue(3, 2, 17.19);data.setValue(3, 3, 32.56);
data.setValue(4, 0, new Date(2011,4,1,00,00,00)); data.setValue(4, 1,
3.54); data.setValue(4, 2, 16.25);data.setValue(4, 3, 32.41);
data.setValue(5, 0, new Date(2011,5,1,00,00,00)); data.setValue(5, 1,
0.11); data.setValue(5, 2, 13.43);data.setValue(5, 3, 32.18);
data.setValue(6, 0, new Date(2011,6,1,00,00,00)); data.setValue(6, 1,
0.24); data.setValue(6, 2, 12.2);data.setValue(6, 3, 31.22);
data.setValue(7, 0, new Date(2011,7,1,00,00,00)); data.setValue(7, 1,
-1.39); data.setValue(7, 2, 13.92);data.setValue(7, 3, 32.51);
data.setValue(8, 0, new Date(2011,8,1,00,00,00)); data.setValue(8, 1,
2.63); data.setValue(8, 2, 14.55);data.setValue(8, 3, 30.98);
data.setValue(9, 0, new Date(2011,9,1,00,00,00)); data.setValue(9, 1,
null); data.setValue(9, 2, null);data.setValue(9, 3, null);
data.setValue(10, 0, new Date(2011,10,1,00,00,00)); data.setValue(10,
1, null); data.setValue(10, 2, null);data.setValue(10, 3, null);
data.setValue(11, 0, new Date(2011,11,1,00,00,00)); data.setValue(11,
1, null); data.setValue(11, 2, null);data.setValue(11, 3, null);var
formateador_fecha = new google.visualization.DateFormat({pattern:
"MMM"});formateador_fecha.format(data,0);
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, {backgroundColor:{strokeWidth:
1},curveType:'none',hAxis:{maxAlternation:1},chartArea:{left:100,top:
50,width:'70%',height:'70%'},width: 700, height: 400, title: 'San
Felix,Temperatura del aire[2011-01-01-2011-12-31]',titleX: 'mes',
titleY: '[°C]', pointSize: 3,lineSize:2, min: 0, max:30});
}