google / google-visualization-issues

288 stars 35 forks source link

Bug: Scatter chart freezing browser on empty data #1275

Open orwant opened 9 years ago

orwant commented 9 years ago
Browser freezes when data is empty.
When breaking in debugger stack is in https://www.google.com/uds/api/visualization/1.1/dab26e217534b91f8d65fda191734f08/format+en,default,corechart.I.js:668
(obfuscated code).

Minimum example:

var data = [];
var table = new google.visualization.DataTable();
table.addColumn('number', 'ix');
table.addColumn('number', 'Expected');
table.addColumn({type: 'string', role: 'tooltip'});
table.addColumn('number', 'Actual');
table.addColumn({type: 'string', role: 'tooltip'});
table.addRows(data);

var element = goog.dom.getElement('plot');
new google.visualization.ScatterChart(element).draw(table, {
  chartArea: {width: 310, left: 60},
  colors: ['#dd4b39', '#4d90fe'],
  hAxis: {gridlines: {color: '#fff'}},
  height: 175,
  legend: {position: 'none'},
  pointSize: 4,
  title: 'Actual vs. Estimated Time',
  vAxis: {title: 'Time (Log Scale)', logScale: true}
});

What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?
ScatterChart

What operating system and browser are you using?
Linux, both Firefox and Chrome

Original issue reported on code.google.com by muellerj@google.com on 2013-08-02 22:28:06

orwant commented 9 years ago
I see the infinite loop.  Nasty.  Will attack as soon as possible.  Thanks for reporting
this.

Original issue reported on code.google.com by dlaliberte@google.com on 2013-08-03 02:53:41