February Date Bug Again - MySQL Data Source

58 views
Skip to first unread message

Brandon Matthews

unread,
Jun 29, 2016, 2:27:22 PM6/29/16
to Google Visualization API

Hi Dan & Co.! 

Hope all are well! 

I too have just fallen victim to this bug that's going around, that is wreaking havoc with the chart displays:

I saw this occur earlier in the year, over a weekend, but the following Monday it resolved on its own: Chalked it up to some update being run or such ...in that instance, 2016 was affected also, but this time it seems to be only 2014 and 2015:




Zoom in 2014: No Feb Data: Feb Data intertwined with March





Zoom in 2015 : No Feb Data: Feb Data intertwined with March




Zoom in 2016, Normal



Different Charts, Different MySQL Database. Same results:




Here's a basic mysql script - variable names changed to protect the innocent


<?php


include("conn.php");


$query="SELECT EXTRACT(YEAR FROM `date`) AS 'year', 

 EXTRACT(MONTH FROM `date`) AS 'month', 

 EXTRACT(DAY FROM `date`) AS 'day', 

 `close`, 

 `anot_code`,

 `alerts` 

 FROM `mySQL_db_2014` 

 WHERE `symbol`='MNKD'  

 UNION ALL 

 SELECT EXTRACT(YEAR FROM `date`) AS 'year', 

 EXTRACT(MONTH FROM `date`) AS 'month', 

 EXTRACT(DAY FROM `date`) AS 'day', 

 `close`, 

 `anot_code`, 

 `alerts` 

 FROM `mySQL_db_2015` 

 WHERE `symbol`='MNKD' 

 FROM  `mySQL_db_2015`  

 WHERE `symbol`='MNKD' 

 UNION ALL 

 SELECT EXTRACT(YEAR FROM `date`) AS 'year', 

 EXTRACT(MONTH FROM `date`) AS 'month', 

 EXTRACT(DAY FROM `date`) AS 'day', 

 `close`, 

 `anot_code`, 

 `alerts` 

 FROM `mySQL_db_2016` 

 WHERE `symbol`='MNKD'  ORDER BY `year` ASC, `month` ASC, `day` ASC"; 


$tabletr=array();


$table['cols']=array(

                      array('label' => 'Date', 'type' => 'date','role' => 'domain'),

                      array('label' => 'Close', 'type' => 'number', 'role' => 'data'), 

                      array('label' => '', 'type' =>'string', 'role' => 'annotation'), 

                      array('label' => '', 'type' =>'string', 'role' => 'annotationText')

                     ); 

$table['rows']=$rows;


$chartdata=mysql_query($query);


while($r=mysql_fetch_assoc($chartdata)) {

                                         $temp=array();

                                         $r['date']= array($r['year'], $r['month']-1, $r['day']);

                                         $r['date']=implode(",", $r[('date')]);

                                         $temp[]=array('v' =>"Date(".$r['date'].")");

                                         $temp[]=array('v' => (float) $r['close']);

                                         $temp[]=array('v' => $r['anot_code']);

                                         $temp[]=array('v' => $r['alerts']);

                                         $rows[]=array('c' => $temp);

                                         };                         

$table['rows']=$rows;

$jsondata=json_encode($table); 

echo $jsondata;

?>


Use this link for resulting json data: better than sticking 3 years of data here:


       http://www.stockshortdata.com/functions/googtest.php



...but here's a screenshot of the 2014 return: Feb $ March highlighted:





...and a chart script if you'd like:

<script type='text/javascript'>
 google.load('visualization','1',{packages:['annotationchart']}); 
 google.setOnLoadCallback(drawChrt); 
  function drawChrt() {
                      var data=new google.visualization.DataTable(<?=$jsonanot?>);
                      var options={
                                 title:'MNKD:Short Volume Alert Price Chart', 
                                 width:'96%', 
                                 height:'400', 
                                 displayAnnotations:'true', 
                                 displayAnnotationsFilter:'true'
                       };
                      var chart =new google.visualization.AnnotationChart(document.getElementById( 'alerts_div')); 
                      chart.draw(data,options); 
  };
</script>

I recall reading that it may be a leap year issue, but as I mentioned, the problem resolved itself by the time I sat don to work that Monday...

Any ideas and does this perhaps help isolate the bug?

If the problem is on Google's end, and you want to troubleshoot it,  the above charts can be located at the following pages:



If you can resolve it on your end again, you'll see it there when you do.

Thanks in advance for any solution suggestions as well...

Dom

Daniel LaLiberte

unread,
Jun 29, 2016, 2:36:21 PM6/29/16
to Google Visualization API
Hi Dom,

There is a bug that shows up at end of every month, but I forgot that February doesn't have a day 29.  I am about to push out an update that should resolve this, but I thought I had an extra day.   Sorry.  Should be fixed in a few hours.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/4cd512a5-8bf1-4f22-9354-9606259b38b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Nick Schirmer

unread,
Jun 30, 2016, 2:45:12 AM6/30/16
to Google Visualization API
Thanks for the update on this bug, Daniel. You mentioned 12 hours ago that it should be fixed in a few hours, but I'm still seeing it on my live production site. Do you have any additional updates for us?

Thanks.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.



--

Brandon Matthews

unread,
Jun 30, 2016, 6:23:48 AM6/30/16
to Google Visualization API
Awesome....I hope You Haven't Applied the Fix Yet Because right now, 2016 is now infected, lol:



...


I know you're on it....just busting em on ya...


Thank You for always being helpful; I couldnt have done anything like this without your guidance..Just sayin...sniff sniff...


Dom





To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.



--

Daniel LaLiberte

unread,
Jun 30, 2016, 10:07:45 AM6/30/16
to Google Visualization API
The update appears complete, but I don't see the date working.  

Furthermore, I don't see dates working properly even on the gstatic server.  So I am confused.  Sorry about all this.  

Perhaps what we thought was a fix really wasn't doing it right after all.

Even if I start reverting this update, it won't finish until tomorrow, at which time the date problem will be "fixed" again anyway for another month.


To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

For more options, visit https://groups.google.com/d/optout.



--

Daniel LaLiberte

unread,
Jun 30, 2016, 12:04:35 PM6/30/16
to Google Visualization API
I take it back.  All the charts look the same to me, but I was reading them wrong.  Had my coffee now, and everything appears to be working correctly.  Check this example out: https://jsfiddle.net/dlaliberte/g1cxenea/

What am I missing?  You may be getting cached copies of the code, so try flushing your cache.  If it still fails for you, please show me a relatively simple example where it fails and I will check it out.  Thanks.

Daniel LaLiberte

unread,
Jun 30, 2016, 1:07:03 PM6/30/16
to Google Visualization API
OK, here is an example that fails:  https://jsfiddle.net/dlaliberte/a8w94w70/
Still not sure why, and what is different from the case that works.  But at least it is reproducible.

Daniel LaLiberte

unread,
Jun 30, 2016, 6:01:44 PM6/30/16
to Google Visualization API
OK, wrong again. Both my previous examples actually fail in the same way, when I load "1.0", but they both succeed when I load "1.1".   So the fix for the Date problem is correct, but it actually appears that the push to production has not quite finished, or perhaps I made a mistake in how it was done.   If it does finish completely, it may be too late for people to see by the end of today.

If you want to see the fix now, you can switch to loading "1.1".  Or you can switch to loading from gstatic.

In any event, I'll make sure this is fixed properly in plenty of time before the next end of month.

Daniel LaLiberte

unread,
Jul 1, 2016, 6:54:27 AM7/1/16
to Google Visualization API
The update for v45 (on the jsapi loader) finally did go out, but unfortunately too late to fix the end of the month bug.  I can tell it went out by examining the code itself.  

Dominick LaViola

unread,
Jul 1, 2016, 2:30:18 PM7/1/16
to google-visua...@googlegroups.com
FWIW, it seems to be a Y2K event....it's not just you!

Check out the dates of the files from these 3 stock exchanges that screwed me  last night  and had me pulling my hair out trying to run my program:







I had to manually retrieve them this morning...sans code.

I wouldnt have found them otherwise even if I was a coding genius. Might this bug of theirs, ....could it possibly then ....pertain to the dilemma you have as well?




--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/hdp_NgVG6q8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.

Dominick LaViola

unread,
Jul 1, 2016, 2:32:22 PM7/1/16
to google-visua...@googlegroups.com
As you expected...New months, perfect charts! Thank You, Dan! Have a great 4th!

On Fri, Jul 1, 2016 at 6:54 AM, 'Daniel LaLiberte' via Google Visualization API <google-visua...@googlegroups.com> wrote:

--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/hdp_NgVG6q8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualizati...@googlegroups.com.

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
Reply all
Reply to author
Forward
0 new messages