Reputation: 1947
I have a an analytics DataChart which displays monthly traffic. The problem is, the x-axis is showing month indices and I want it to show month name labels (e.g. January, February, March, etc.). Is there a way I can format the month axis as the month name?
var pastYearChart = new gapi.analytics.googleCharts.DataChart({
query: {
'ids': my_ID,
'start-date': '365daysAgo',
'end-date': 'today',
'metrics': 'ga:sessions,ga:users',
'dimensions': 'ga:month'
},
chart: {
'container': 'traffic-past-year-container',
'type': 'COLUMN',
'options': {
'width': '100%'
}
}
});
Upvotes: 0
Views: 1190
Reputation:
var month = [
"January",
"February",
"etc"
];
for(var i = 0, len = month.length; i < len; i++) {
// month[i] contains your month based on your index
}
Upvotes: 1