[visualization-api] Problem with the Range Selection Area

13 views
Skip to first unread message

Albert

unread,
Sep 30, 2009, 6:03:19 AM9/30/09
to google-visua...@googlegroups.com

Hi. I have found some inconsistense betwen the main graph of the annotation time line and the graph displayed in the range selection area.

You can see in the picture the "unlogic" diferences. Is that a known bug. I'm doing something wrong?
annotated.png

Albert

unread,
Oct 1, 2009, 2:25:50 PM10/1/09
to google-visua...@googlegroups.com
any tips on that? is that a bug or a malfunction?

VizGuy

unread,
Oct 1, 2009, 3:29:38 PM10/1/09
to google-visua...@googlegroups.com
While this looks like a bug, I have never seen other cases like this.

The line at the range selection are is a logarithmic manipulation of the last (in this case - only) data line.

Could you provide some real data that creates this problem so we can track it down?


Thanks,
VizGuy

Albert

unread,
Oct 1, 2009, 3:48:19 PM10/1/09
to google-visua...@googlegroups.com
Hello and thanks for the reply. Here is the Json object I use to build the datatable object that feeds the graph.

{cols:[{label:'date',type:'date'},{label:'',type:'number'}],rows: [{c:[{v:new Date(2007,02,01)},{v:0.3}]},{c:[{v:new Date(2007,02,28)},{v:0.3}]},{c:[{v:new Date(2007,03,30)},{v:0.1}]},{c:[{v:new Date(2007,05,01)},{v:0.1}]},{c:[{v:new Date(2007,05,29)},{v:0.1}]},{c:[{v:new Date(2007,06,30)},{v:0.1}]},{c:[{v:new Date(2007,07,31)},{v:0.1}]},{c:[{v:new Date(2007,08,28)},{v:0.1}]},{c:[{v:new Date(2007,10,01)},{v:0.2}]},{c:[{v:new Date(2007,10,30)},{v:0.2}]},{c:[{v:new Date(2007,11,21)},{v:0.2}]},{c:[{v:new Date(2007,12,31)},{v:0.2}]},{c:[{v:new Date(2008,01,29)},{v:0.3}]},{c:[{v:new Date(2008,02,28)},{v:0.1}]},{c:[{v:new Date(2008,04,01)},{v:0.2}]},{c:[{v:new Date(2008,04,30)},{v:0.1}]},{c:[{v:new Date(2008,05,27)},{v:0.1}]},{c:[{v:new Date(2008,07,04)},{v:0.3}]},{c:[{v:new Date(2008,07,29)},{v:0.3}]},{c:[{v:new Date(2008,08,29)},{v:0.2}]},{c:[{v:new Date(2008,09,30)},{v:0.2}]},{c:[{v:new Date(2008,10,26)},{v:0}]},{c:[{v:new Date(2008,11,24)},{v:0}]},{c:[{v:new Date(2009,01,02)},{v:0}]},{c:[{v:new Date(2009,02,02)},{v:0.2}]},{c:[{v:new Date(2009,02,27)},{v:0.2}]},{c:[{v:new Date(2009,03,30)},{v:0.2}]},{c:[{v:new Date(2009,05,01)},{v:0.3}]},{c:[{v:new Date(2009,05,26)},{v:0.1}]},{c:[{v:new Date(2009,07,04)},{v:0.2}]},{c:[{v:new Date(2009,07,28)},{v:0.1}]}]}

here is the js function I use to draw the graf

function drawIt(datatable, div) { eval("var jsonObject =" + datatable); var data = new google.visualization.DataTable(jsonObject); var chart = new google.visualization.AnnotatedTimeLine(document.getElementById(div)); $('loaderImg').remove(); chart.draw(data, { 'displayAnnotations': false, 'displayAnnotationsFilter':false, 'allowHtml':true, 'fill': 20, 'thickness': 2 }); }

the result is the attached image.


thanks.

You can browse more examples on our site http://www.fxstreet.com/fundamental/economic-calendar/ after cliking one of the displayed events and inside the history tab.
result.png

VizGuy

unread,
Oct 1, 2009, 8:32:37 PM10/1/09
to google-visua...@googlegroups.com
In this example there is indeed a but, but I think its not the same one.
Here you can see that in general the two charts are the same, except for the two zero value that look like max values instead.

In the first example you sent there is a bigger diff between the charts.

We will look at this problem, but if you can still send data to recreate the first problem, it will help.


Thanks,
VizGuy

Albert

unread,
Oct 2, 2009, 3:20:11 AM10/2/09
to google-visua...@googlegroups.com
here you have the data for the first example.

{cols:[{label:'date',type:'date'},{label:'',type:'number'}],rows: [{c:[{v:new Date(2007,08,27)},{v:0.9}]},{c:[{v:new Date(2007,09,24)},{v:0.9}]},{c:[{v:new Date(2007,10,21)},{v:0.8}]},{c:[{v:new Date(2007,11,21)},{v:0.6}]},{c:[{v:new Date(2007,12,23)},{v:0.6}]},{c:[{v:new Date(2008,02,29)},{v:0.6}]},{c:[{v:new Date(2008,03,25)},{v:0.3}]},{c:[{v:new Date(2008,04,23)},{v:0.5}]},{c:[{v:new Date(2008,05,30)},{v:0.3}]},{c:[{v:new Date(2008,06,25)},{v:0.4}]},{c:[{v:new Date(2008,07,29)},{v:0.2}]},{c:[{v:new Date(2008,09,01)},{v:-0.1}]},{c:[{v:new Date(2008,09,24)},{v:-0.3}]},{c:[{v:new Date(2008,10,26)},{v:-0.5}]},{c:[{v:new Date(2008,11,23)},{v:-0.3}]},{c:[{v:new Date(2008,12,23)},{v:-0.5}]},{c:[{v:new Date(2009,01,25)},{v:-0.8}]},{c:[{v:new Date(2009,02,28)},{v:-1.3}]},{c:[{v:new Date(2009,03,24)},{v:-1.3}]},{c:[{v:new Date(2009,04,22)},{v:-1.2}]},{c:[{v:new Date(2009,06,01)},{v:-1.2}]},{c:[{v:new Date(2009,06,24)},{v:-1}]},{c:[{v:new Date(2009,07,28)},{v:-0.6}]},{c:[{v:new Date(2009,08,30)},{v:-0.2}]}]}

Albert

unread,
Oct 2, 2009, 6:23:43 AM10/2/09
to google-visua...@googlegroups.com
I've did a bit of teorycrafting and looks like you have some issues with numbers between -1 and 1. Or what's it's the same with Numbers around 0. Where the logarithmic function returns negative values.

A logarithmic function has negative values around those values, so the error seems in that mathematical function. I'm GUESSING the problem is a sign problem  Around those values.

I'm just guessing by the results and the data, since I do not have the matematical function you're using. But after thinking on it. I think it should be something around that.

But doing some research with google play ground I added to the upper values 1.3 to make all the values positive and the chart looks great

here you have the code:

function drawVisualization({
  var object {cols:[{label:'date',type:'date'},{label:'',type:'number'}],rows[{c:[{v:newDate(2007,08,27)},{v:2.2}]},{c:[{v:new Date(2007,09,24)},{v:2.2}]},{c:[{v:newDate(2007,10,21)},{v:2.1}]},{c:[{v:new Date(2007,11,21)},{v:1.9}]},{c:[{v:newDate(2007,12,23)},{v:1.9}]},{c:[{v:new Date(2008,02,29)},{v:1.9}]},{c:[{v:newDate(2008,03,25)},{v:1.6}]},{c:[{v:new Date(2008,04,23)},{v:1.8}]},{c:[{v:newDate(2008,05,30)},{v:1.8}]},{c:[{v:new Date(2008,06,25)},{v:1.7}]},{c:[{v:newDate(2008,07,29)},{v:1.5}]},{c:[{v:new Date(2008,09,01)},{v:1.2}]},{c:[{v:newDate(2008,09,24)},{v:1.0}]},{c:[{v:new Date(2008,10,26)},{v:0.8}]},{c:[{v:newDate(2008,11,23)},{v:1.0}]},{c:[{v:new Date(2008,12,23)},{v:0.8}]},{c:[{v:newDate(2009,01,25)},{v:0.5}]},{c:[{v:new Date(2009,02,28)},{v:0.0}]},{c:[{v:newDate(2009,03,24)},{v:0.0}]},{c:[{v:new Date(2009,04,22)},{v:0.1}]},{c:[{v:newDate(2009,06,01)},{v:0.1}]},{c:[{v:new Date(2009,06,24)},{v:0.3}]},{c:[{v:newDate(2009,07,28)},{v:0.7}]},{c:[{v:new Date(2009,08,30)},{v:1.1}]}]};
  
  var data new google.visualization.DataTable(object);
  
  
  var annotatedtimeline new google.visualization.AnnotatedTimeLine(
      document.getElementById('visualization'));
  annotatedtimeline.draw(data{'displayAnnotations'true});
}


Finaly just inc ase I did a new try now with negative values all smaller than -0.9 and again the graphic looks great.

Here you have the code.

function drawVisualization({
  var object {cols:[{label:'date',type:'date'},{label:'',type:'number'}],rows[{c:[{v:newDate(2007,08,27)},{v:-2.2}]},{c:[{v:new Date(2007,09,24)},{v:-2.2}]},{c:[{v:newDate(2007,10,21)},{v:-2.1}]},{c:[{v:new Date(2007,11,21)},{v:-1.9}]},{c:[{v:newDate(2007,12,23)},{v:-1.9}]},{c:[{v:new Date(2008,02,29)},{v:-1.9}]},{c:[{v:newDate(2008,03,25)},{v:-1.6}]},{c:[{v:new Date(2008,04,23)},{v:-1.8}]},{c:[{v:newDate(2008,05,30)},{v:-1.8}]},{c:[{v:new Date(2008,06,25)},{v:-1.7}]},{c:[{v:newDate(2008,07,29)},{v:-1.5}]},{c:[{v:new Date(2008,09,01)},{v:-1.2}]},{c:[{v:newDate(2008,09,24)},{v:-1.0}]},{c:[{v:new Date(2008,10,26)},{v:-1.8}]},{c:[{v:newDate(2008,11,23)},{v:-1.0}]},{c:[{v:new Date(2008,12,23)},{v:-1.8}]},{c:[{v:newDate(2009,01,25)},{v:-1.5}]},{c:[{v:new Date(2009,02,28)},{v:-1.0}]},{c:[{v:newDate(2009,03,24)},{v:-1.0}]},{c:[{v:new Date(2009,04,22)},{v:-1.1}]},{c:[{v:newDate(2009,06,01)},{v:-1.1}]},{c:[{v:new Date(2009,06,24)},{v:-1.3}]},{c:[{v:newDate(2009,07,28)},{v:-1.7}]},{c:[{v:new Date(2009,08,30)},{v:-1.1}]}]};
  
  var data new google.visualization.DataTable(object);
  
  
  var annotatedtimeline new google.visualization.AnnotatedTimeLine(
      document.getElementById('visualization'));
  annotatedtimeline.draw(data{'displayAnnotations'true});
}



My guess is that you have something wrong when the numbers go around -1 and 1. Hope I helped you to track that issue

VizGuy

unread,
Oct 2, 2009, 7:27:20 AM10/2/09
to google-visua...@googlegroups.com
Many thanks for the research.
It is probably the exact issue you are describing, and it indeed explain both cases.

We will open a bug to track this one.

Thanks,
VizGuy

Albert

unread,
Oct 2, 2009, 10:18:13 AM10/2/09
to google-visua...@googlegroups.com
nice :).
Reply all
Reply to author
Forward
0 new messages