Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Problem with query. Dates are returned as strings. #41

Open
rjborter opened this issue Apr 9, 2015 · 2 comments
Open

Problem with query. Dates are returned as strings. #41

rjborter opened this issue Apr 9, 2015 · 2 comments

Comments

@rjborter
Copy link

rjborter commented Apr 9, 2015

I built a simple query using the Explorer to bring back the number of visits for each day during a 60 day period which is working and have the URL copied to the superProxy in the apps engine. When I create a web page using the URL and display the results using Google Charts the labels along the x-axis are in the yyyymmdd string format. When I examine the data returned using the Manage Query page the data is listed as STRING no matter what format I click on (DataTable JSON Response, JSON String or just JSON) I have tried placing option=dataTable in the query string but that just seems to break the query. Is there some setting I am missing or is this a bug?

@pfrisella
Copy link
Contributor

So everything is working, you just don't like the format of the date when using Google Charts? Have you looked at trying to change the format as described in Formatting Axis, Gridline, and Tick Labels?

@rjborter
Copy link
Author

This is what I am using

var browserWrapper = new google.visualization.ChartWrapper({
"containerId": "browser",
"dataSourceUrl": "https://
(mysite)/query?id=ag1zfnZkb3QtY3NjLTIwchULEghBcGlRdWVyeRiAgICAgICACgw&format=data-table-response",
"refreshInterval": 43000,
"chartType": "LineChart",
"options": {
"showRowNumber" : true,
"width": 630,
"height": 440,
"is3D": true,
"hAxis":{format:'MMM d, y'},
"vAxis": {"title": "Volume"},
"title": "CSC Test Script"
}
});

But I think the problem is how the data in the query is returned. No
matter what format is chosen on the "Manage" page (DataTable (JSON
Response) DataTable (JSON String) JSON ) the data coming back lists the
ga:date field as a string and I would think this should come back as a date.

From the "Response Info" page the heading info states--

u'columnHeaders': [{u'dataType': u'STRING', u'columnType': u'DIMENSION',
u'name': u'ga:date'},

Maybe I am setting something up wrong in the query or I am using hAxis
incorrectly?

Any suggestion is appreciated.

--Robert

On Thu, Apr 9, 2015 at 4:30 PM, Pete Frisella [email protected]
wrote:

So everything is working, you just don't like the format of the date when
using Google Charts? Have you looked at trying to change the format as
described in Formatting Axis, Gridline, and Tick Labels
https://developers.google.com/chart/interactive/docs/datesandtimes#axesgridlinesticks
?


Reply to this email directly or view it on GitHub
#41 (comment)
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants