谷歌线图api haxis日期 [英] google line-chart api for haxis for date

查看:116
本文介绍了谷歌线图api haxis日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我每天都有一份数据更新清单。

  data.addColumn('date','Date'); 
data.addColumn('number','Calorie');
data.addRows([
[new Date(2012,7,1),400],
[new Date(2012,7,2),460],

日期将会增加3个月,我有什么方法可以在每个月的第1天只显示haxis。 / b>

  hAxis:{
gridlines:{count:3,color:'white'},
minValue:新日期(2012,1,31),
maxValue:新日期(2012,9,30),
showTextEvery:30,
格式:'d-MMM',
},

这是我目前的haxis api代码,它只能显示1 - 8月份。 >

解决方案

  hAxis:{
gridlines:{count:3,color:'white'},
minValue:new Date(2012,1,31),
maxValue:new日期(2012,9,30),
// showTextEvery:30,
格式:'d-MMM'
}

查看此 jqfaq.com 网站,它有Google图表相关的常见问题。这可能对您有所帮助。

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.

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.

这篇关于谷歌线图api haxis日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆