最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Google Chart: add vertical line on every monday - Stack Overflow

programmeradmin0浏览0评论

I need to add one vertical line on google chart marking monday. as shown in picture.

all of other things has been done.. but couldn't figure out how to put vertical line marking every monday. I found this

hAxis: {
            ticks: ""
        },

functionality in google chart use i can make user of.. but couldn't figure out how do i use it for every monday....

I need to add one vertical line on google chart marking monday. as shown in picture.

all of other things has been done.. but couldn't figure out how to put vertical line marking every monday. I found this

hAxis: {
            ticks: ""
        },

functionality in google chart use i can make user of.. but couldn't figure out how do i use it for every monday....

Share asked Sep 1, 2014 at 0:53 user98239820user98239820 1,4912 gold badges16 silver badges31 bronze badges 1
  • 2 There are a couple of ways to do this. In order to use hAxis.ticks, your domain column (x-axis) must be type "date"; using it will show tick marks and labels only on the dates you specify (so in your example, you would lose the "Aug 13", "Aug 15", and "Aug 17" labels in between "Aug 11" and "Aug 18"). You can also use domain axis annotations to add labeled vertical lines to your chart, which might be a better fit if you are looking to get a close duplicate of the image. – asgallant Commented Sep 1, 2014 at 15:29
Add a ment  | 

1 Answer 1

Reset to default 5

Use This in data:

 data.addColumn({type: 'string', role: 'annotation'});

And this in options:

annotations: {
        style: 'line'
    }

See: http://jsfiddle/NC37X/

发布评论

评论列表(0)

  1. 暂无评论