google / google-visualization-issues

288 stars 35 forks source link

Issue with google charts across months #2259

Open mailaravinda opened 8 years ago

mailaravinda commented 8 years ago

Issue with google charts across months

charts working fine on daily basis from Dec 2015 till 29th April 2016 I track daily data of stocks.. so charts are based on time lines.. on 30th Apr charts are incorrect.. chart plots 29th Feb and for 1st Mar it goes back to 1st of Feb.. and charts 1month incorrectly.. pls look into this.. output_snap0603

jcw- commented 8 years ago

I noticed what I think is the same problem in Google Sheets in the Line Chart and the Time Line Chart. A simpler reproduction is to add the following formula to a cell in Google Sheets, put it into a Line Chart, and then turn on data values:

={DATE(2016,1,1),1;DATE(2016,2,1),2;DATE(2016,3,1),3;DATE(2016,4,1),4;DATE(2016,5,1),5}

image

You can see that Feb dates are being interpreted as March values (Feb 1 gets plotted as March 1). Possibly a leap day related bug?

bryceb04 commented 8 years ago

screenshot from 2016-04-30 20-37-06

Can I upvote this issue?

mailaravinda commented 8 years ago

you can update.. but never mind charts looks good now.. either someone fixed or TIME itself fixed it :) charts are showing good now.

dlaliberte commented 8 years ago

Nothing has changed on the Google Charts side. It does appear there is/was some change in how months are interpreted, but nothing in Charts would cause that as far as I am aware.

dilipmarar commented 8 years ago

I'm still able to reproduce this issue as of today. Does anyone know of a solution or workaround for this?

dilipmarar commented 8 years ago

The issue gets resolved of the new library loader code is used.

DhandapaniN commented 8 years ago

Hi, I have same issue, i am passing value to this format: Date(2016, 1, 1) to Date(2016, 1, 29), then it is displaying in 2016 March 1 to 29 . Is it a bug? Please help me to solve this!

dilipmarar commented 8 years ago

Instead of loading "https://www.google.com/jsapi" use https://www.gstatic.com/charts/loader.js

To load the packages use google.charts.load('current', {packages: ['corechart']});

Please refer the google charts getting started section.

This worked for me.

DhandapaniN commented 8 years ago

Thanks for your response. After using the above code. I am facing new issue that, 1. Google.load is not a function 2. One or more participants failed to draw. Didnt change any code other than updated loaded code.

mbence commented 8 years ago

Had the same issue today, but changing the loader fixed it. More info about it: https://developers.google.com/chart/interactive/docs/basic_load_libs Not sure when this was changed, but thanks @dilipmarar for the workaround!

dlaliberte commented 8 years ago

If you switch from loading "https://www.google.com/jsapi" to https://www.gstatic.com/charts/loader.js then you MUST also change your google.load() call to google.charts.load() (with slightly different parameters) and change google.setOnLoadCallback() to google.charts.setOnLoadCallback().

dilipmarar commented 8 years ago

You need to change to Google.charts.load On 31-May-2016 13:17, "Dhandapani N" notifications@github.com wrote:

Thanks for your response. After using the above code. I am facing new issue that, 1. Google.load is not a function 2. One or more participants failed to draw. Didnt change any code other than updated loaded code.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/google-visualization-issues/issues/2259#issuecomment-222615843, or mute the thread https://github.com/notifications/unsubscribe/ASvQrX2ho_BJeV_KSq473XTgD_FHMKURks5qG-eKgaJpZM4ITUHU .

cledupe commented 8 years ago

@dlaliberte you are a genius

dlaliberte commented 8 years ago

Thanks, but if I were enough of a genius, I would have avoided creating the bug that caused all this. Or I should have noticed what was going on a month ago. Difficult to anticipate everything.