I have the page http://goodandevilbook.com/stats where I am using google charts to display data.
On one of the charts (the area chart) When I hover over the tool tip, it displays the date in a hard-to-read format. I would like to format this date into a more readable way. Also, the tooltip displays ga:visitors, and I would like to change this to just Visitors. I can't really put the JSON file data into the desired format, because that is generated automatically
Somehow, I need to change this data once I have it received. Here is the code where I generate the Area Chart:
google.setOnLoadCallback(drawGraph);
function drawGraph(){
var graph = new google.visualization.ChartWrapper({
"containerId":"last30chart",
"dataSourceUrl":"http://good-and-evil-stats.appspot.com/query?id=ahVzfmdvb2QtYW5kLWV2aWwtc3RhdHNyFQsSCEFwaVF1ZXJ5GICAgICA14wKDA&format=data-table-response",
"refreshInterval":0,
"chartType":"AreaChart",
"options":{
"width":675,
"height":400,
"chartArea":{width:"95%", height:"83%"},
"areaOpacity":0.1,
"pointSize":4,
"backgroundColor":"transparent",
"colors":['#76BB72'],
"legend":{position: 'none'},
"tooltip":{textStyle: {fontSize:18}},
"hAxis":{textPosition:"none", gridlines: {color: 'red', count: 7}},
"dateFormat":{formatType: "long"}
}
});
graph.draw();}
I have tried to insert the code for formating the date.
https://developers.google.com/chart/interactive/docs/reference#dateformatter
this is what I was playing around with:
var monthYearFormatter = new google.visualization.DateFormat({
pattern: "MMM yyyy"
});
monthYearFormatter.format(dataSourceUrl);
I've tried playing around with this for quite awhile, and can't get it to work. I am new to Javascript/jquery and so am not really sure what I'm doing.