google / google-visualization-issues

288 stars 35 forks source link

Annotated Timeline crashes maximizing scale columns when selected time range of column has all null values #6

Open orwant opened 9 years ago

orwant commented 9 years ago
We have encountered an issue where the Annotated Timeline will hang
and display -inf, nan for scale values.

The following reproduces the issue using the AJAX API Playground.  It
is a minor alteration of the example code for the annotated timeline
(some null values, scaleType=allmaximize).  After loading the
following, drag the right time slider such that the time range
selected is all null values for the second series.

1. Go to http://code.google.com/apis/ajax/playground/#annotated_time_line
2. Paste this code:

function drawVisualization() {
       var data = new google.visualization.DataTable();
        data.addColumn('date', 'Date');
        data.addColumn('number', 'Sold Pencils');
        data.addColumn('string', 'title1');
        data.addColumn('string', 'text1');
        data.addColumn('number', 'Sold Pens');
        data.addColumn('string', 'title2');
        data.addColumn('string', 'text2');
        data.addRows(6);
        data.setValue(0, 0, new Date(2008, 1 ,1));
        data.setValue(0, 1, 30000);
        data.setValue(0, 4, null);
        data.setValue(1, 0, new Date(2008, 1 ,2));
        data.setValue(1, 1, 14045);
        data.setValue(1, 4, null);
        data.setValue(2, 0, new Date(2008, 1 ,3));
        data.setValue(2, 1, 55022);
        data.setValue(2, 4, 23432);
        data.setValue(3, 0, new Date(2008, 1 ,4));
        data.setValue(3, 1, 75284);
        data.setValue(3, 4, 14334);
        data.setValue(3, 5, 'Out of Stock');
        data.setValue(3, 6, 'Ran out of stock on pens at 4pm');
        data.setValue(4, 0, new Date(2008, 1 ,5));
        data.setValue(4, 1, 41476);
        data.setValue(4, 2, 'Bought Pens');
        data.setValue(4, 3, 'Bought 200k pens');
        data.setValue(4, 4, 66467);
        data.setValue(5, 0, new Date(2008, 1 ,6));
        data.setValue(5, 1, 33322);
        data.setValue(5, 4, 39463);

        var chart = new
google.visualization.AnnotatedTimeLine(document.getElementById('visualization'));
        chart.draw(data, {displayAnnotations: true,
scaleType:'allmaximize', scaleColumns: [0,1]}); 
}

3. Run code.
4. Drag right slider to the left beyond where the sparkline ends.

Original issue reported on code.google.com by mose.andre on 2009-07-27 21:36:02


orwant commented 9 years ago
Here's a screenshot of the Flash player suggesting you abort the visualization.

Original issue reported on code.google.com by mose.andre on 2009-07-27 21:39:20


orwant commented 9 years ago
I think the annotated timeline visualization doesn't deal with null values properly
at all.
If there are null values in the dataset no line should be drawn because there is a
gap in the 
dataset.
The basic line chart does this correctly. 
The annotated timeline should not draw a line between two data points if there is a
null 
value in-between,

Original issue reported on code.google.com by AndyJessCalendar on 2009-08-10 12:09:13