google / google-visualization-issues

288 stars 35 forks source link

Bug: ImageSparkLine generates incorrect image dimensions if a long left label is used #744

Open orwant opened 9 years ago

orwant commented 9 years ago
What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.
1.  Use this code to generate 2 spark lines:
function drawVisualization() {
  // Create and populate the data table.
  var data = new google.visualization.DataTable();
  data.addColumn("number", "Revenue Revenue Revenue Revenue Revenue");
  data.addColumn("number", "Licenses Licenses Licenses Licenses");
  data.addRows(10);
  data.setValue(0,0,835);
  data.setValue(1,0,438);
  data.setValue(2,0,512);
  data.setValue(3,0,460);
  data.setValue(4,0,491);
  data.setValue(5,0,487);
  data.setValue(6,0,552);
  data.setValue(7,0,511);
  data.setValue(8,0,505);
  data.setValue(9,0,509);

  data.setValue(0,1,132);
  data.setValue(1,1,131);
  data.setValue(2,1,137);
  data.setValue(3,1,142);
  data.setValue(4,1,140);
  data.setValue(5,1,139);
  data.setValue(6,1,147);
  data.setValue(7,1,146);
  data.setValue(8,1,151);
  data.setValue(9,1,149);

  // Create and draw the visualization.
  new google.visualization.ImageSparkLine(
    document.getElementById('visualization')).draw(data, {width:400, height: 60, labelPosition:
'left'});
}
​
2.  See attached image for result 

What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)? google.visualization.ImageSparkLine, ImageSparkLine

Are you using the test environment (version 1.1)?
(If you are not sure, answer NO)
No, unsure

What operating system and browser are you using?
Tested on: 
Mac Osx - 10.6.8 - Chrome 16.0.912.41 beta - FAIL - Results in image seen
Windows 7 - IE 9 - PASS - Correctly generated image

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by coryborg on 2011-11-22 01:42:05


orwant commented 9 years ago
Both sparklines should be identical in size (width and height), they are not.

This bug may be related to:
http://code.google.com/p/google-visualization-api-issues/issues/detail?id=371

and

http://code.google.com/p/google-visualization-api-issues/issues/detail?id=387

Original issue reported on code.google.com by coryborg on 2011-11-22 18:44:21