Issue 1455 in google-visualization-api-issues: Bug: annotations broken/unsupported on DiffCharts

0 views
Skip to first unread message

google-visualiz...@googlecode.com

unread,
Jan 21, 2014, 11:59:09 AM1/21/14
to google-visualiz...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 1455 by drew_gal...@abtassoc.com: Bug: annotations
broken/unsupported on DiffCharts
http://code.google.com/p/google-visualization-api-issues/issues/detail?id=1455

What steps will reproduce the problem? Please provide a link to a
demonstration page if at all possible, or attach code.

I suspect that annotations (and probably other column roles as well, though
I haven't explicitly tested for them) are simply not supported yet on
DiffCharts, but I'm filing this as a bug report in case they are supposed
to be working.

First off, in order to compute a diff on two data sources, both sources
must contain the same column types - including the same additional role
columns - even if one data set does not use the role(s). Ex:

var oldData = new google.visualization.DataTable({
cols: [
{type: 'string', label: 'Name'},
{type: 'number', label: 'Value'}
],
rows: [/*...*/]
});
var newData = new google.visualization.DataTable({
cols: [
{type: 'string', label: 'Name'},
{type: 'number', label: 'Value'},
{type: 'string', role: 'annotation'}
],
rows: [/*...*/]
});
var diffData = myChart.computeDiff(oldData, newData);

fails with the error: "Uncaught Error: Invalid column index 2. Should be an
integer in the range [0-1]." (see fiddle:
http://jsfiddle.net/asgallant/MsRj3/).

Adding in the annotation column to "oldData" gets past computing the diff
data, but gives a DataTable with this structure:

{
cols: [
{type: 'string', label: 'Name'},
{type: 'number', label: 'Value', role: 'old-data', p:
{role: 'old-data'}},
{type: 'number', label: 'Value', role: 'data', p: {role: 'data'}},
{type: 'string', role: 'old-data', p: {role: 'old-data'}},
{type: 'string', role: 'data', p: {role: 'data'}}
],
rows: [/*...*/]
}

Which then causes an error when drawing the chart: "All series on a given
axis must be of the same data type"; we should expect this given that
the "annotation" roles are not preserved (see fiddle:
http://jsfiddle.net/asgallant/MsRj3/2/). A DataView that reorders the
columns and give them proper roles should fix the problem:

var view = new google.visualization.DataView(diffData);
view.setColumns([0, 1, {
sourceColumn: 3,
role: 'annotation'
}, 2, {
sourceColumn: 4,
role: 'annotation'
}]);

but drawing the chart with the view then gives an odd error: "Invalid row
index <n>. Should be in the range [0-<n - 1>]." (where n is the number of
rows in the diffData DataTable; see fiddle:
http://jsfiddle.net/asgallant/MsRj3/3/).

The DiffCharts should support the full range of column roles supported by
the base chart for both the new and old data sets.

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

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


What operating system and browser are you using?
Chrome, Windows 7 x64


*********************************************************
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.
*********************************************************


--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

google-visualiz...@googlecode.com

unread,
Feb 10, 2014, 11:25:35 AM2/10/14
to google-visualiz...@googlegroups.com
Updates:
Status: Accepted

Comment #1 on issue 1455 by dlalibe...@google.com: Bug: annotations
You are quite right that several features, particularly the roles, were not
supported in combination with diff charts. It may be possible to add
support for some of them without too much effort. We'll have to
investigate.

google-visualiz...@googlecode.com

unread,
Oct 23, 2014, 5:38:15 AM10/23/14
to google-visualiz...@googlegroups.com

Comment #2 on issue 1455 by alexandr...@ipa-consulting.fr: Bug: annotations
broken/unsupported on DiffCharts
https://code.google.com/p/google-visualization-api-issues/issues/detail?id=1455

Hi, is there any evolution for this problem?

google-visualiz...@googlecode.com

unread,
Oct 23, 2014, 11:12:46 AM10/23/14
to google-visualiz...@googlegroups.com

Comment #3 on issue 1455 by dlalibe...@google.com: Bug: annotations
We haven't had time to investigate this. We are more inclined to put our
efforts elsewhere, and revisit diff charts at a later time with a much more
general framework.

google-visualiz...@googlecode.com

unread,
Oct 23, 2014, 11:19:00 AM10/23/14
to google-visualiz...@googlegroups.com

Comment #4 on issue 1455 by momtaz...@gmail.com: Bug: annotations
Alexandr, you can modify the code to fix this. Just a do a search on the
code to locate it and modify it. See attached. I changed it to "New and
Revisions". The modified code in included.

Good luck

Attachments:
KeyPerformance.html 668 KB

google-visualiz...@googlecode.com

unread,
Dec 31, 2014, 7:08:38 AM12/31/14
to google-visualiz...@googlegroups.com

Comment #5 on issue 1455 by rahul.n...@gmail.com: Bug: annotations
Hi,
Awaiting update on this problem.

google-visualiz...@googlecode.com

unread,
Feb 19, 2015, 7:23:01 AM2/19/15
to google-visualiz...@googlegroups.com

Comment #6 on issue 1455 by hodorog...@gmail.com: Bug: annotations
I am unhappy with this situation. All we need is to have CURRENT and FUTURE
or a YEAR instead of FUTURE. Can it be that it's something that takes more
than a year to run?

Can you please advise on an alternative?

google-visualiz...@googlecode.com

unread,
Apr 27, 2015, 6:46:38 AM4/27/15
to google-visualiz...@googlegroups.com

Comment #7 on issue 1455 by alexandr...@ipa-consulting.fr: Bug: annotations
Hello,

Is there change for this bug?

Alexandre.

google-visualiz...@googlecode.com

unread,
May 1, 2015, 1:42:36 PM5/1/15
to google-visualiz...@googlegroups.com

Comment #8 on issue 1455 by vidurobe...@gmail.com: Bug: annotations
Hi Guys.

Any update on this ?

google-visualiz...@googlecode.com

unread,
May 2, 2015, 10:49:11 AM5/2/15
to google-visualiz...@googlegroups.com
Updates:
Owner: dlalibe...@google.com

Comment #9 on issue 1455 by dlalibe...@google.com: Bug: annotations
We are planning to add new kinds of intervals to represent the diffs. It
might be a couple months before we get to it, however.
Reply all
Reply to author
Forward
0 new messages