问题
I am having a list of data update daily based.
data.addColumn('date', 'Date');
data.addColumn('number', 'Calorie');
data.addRows([
[new Date(2012,7,1), 400],
[new Date(2012,7,2), 460],
the date will increase for 3 months is there any way for me to display only 1st day of the month in the haxis.
hAxis: {
gridlines:{count:3, color: 'white'},
minValue: new Date(2012, 1, 31),
maxValue: new Date(2012, 9, 30),
showTextEvery:30,
format:'d-MMM',
},
that is my current haxis api code. it somehow display only 1-Aug.
回答1:
To get the result as your wish comment the showTextEvery property in options object.
hAxis: {
gridlines:{count:3, color: 'white'},
minValue: new Date(2012, 1, 31),
maxValue: new Date(2012, 9, 30),
// showTextEvery:30,
format:'d-MMM'
}
Take a look at this jqfaq.com site,it has Google charts related faqs. It may be helpful to you.
来源:https://stackoverflow.com/questions/14150233/google-line-chart-api-for-haxis-for-date