Maximum values in line chart

3,589 views
Skip to first unread message

faizan_...@yahoo.com

unread,
Apr 15, 2010, 3:12:49 AM4/15/10
to Google Visualization API, fai...@sdi.la
Hello ,
I am using the google chart [line-chart].
I have set min value : 300 , max: value : 800 .
But in the data , my maximum value is : 600 .
So my graph displays 600 as max. value on the y-axis , how can I get
800 as max value on the y-axis .

Bug Chart

unread,
Apr 15, 2010, 9:01:28 AM4/15/10
to google-visua...@googlegroups.com
Hi,

as written here:

you can't truncate given values,
but you can use higher values for maximum,
or lower than the data min as min values.

for example, here:

function drawVisualization({
  // Create and populate the data table.
  var data new google.visualization.DataTable();
  data.addColumn('string''x');
  data.addColumn('number''Cats');
  data.addColumn('number''Blanket 1');
  data.addColumn('number''Blanket 2');
  data.addRow(["A"110.5]);
  data.addRow(["B"20.51]);
  data.addRow(["C"410.5]);
  data.addRow(["D"80.51]);
  data.addRow(["E"710.5]);
  data.addRow(["F"70.51]);
  data.addRow(["G"810.5]);
  data.addRow(["H"40.51]);
  data.addRow(["I"210.5]);
  data.addRow(["J"3.50.51]);
  data.addRow(["K"310.5]);
  data.addRow(["L"3.50.51]);
  data.addRow(["M"110.5]);
  data.addRow(["N"10.51]);
 
  // Create and draw the visualization.
  new google.visualization.LineChart(document.getElementById('visualization')).
    draw(data{min3max50smoothLinetruewidth900height400});  
}

HTH,

BugChart.
Reply all
Reply to author
Forward
0 new messages