The ticks option only works with axes that have continuous values, not
discrete values.  Since your data is really dates, it would probably be
better if you use actual dates in your data table, and then the ticks
option should work with dates as well.

hAxis: { title: "Days", ticks: [{v: new Date(2018, 4, 1), f:"2018-05-10"},
                                            {v: new Date(2018, 4,11),
f:"2018-05-11"}] },

Note that month numbers start at 0.

On Wed, May 30, 2018 at 4:33 PM drigo <[email protected]> wrote:

> Hi everybody,
>
> I would need some help in order to use ticks on hAxis when I have strings
> on such an axis.
> Specifically, i have things like the following: '2018-05-01', '2018-05-02'
> etc.
>
> I would like to select few of them only in order to make my x-axis
> clearer.
>
> I have found the examples below in the google chart documentation  but
> they do not
> solve my issue.
>
> Example:
>
>
>    - hAxis: { ticks: [5,10,15,20] }
>    - hAxis: { ticks: [{v:32, f:'thirty two'}, {v:64, f:'sixty four'}] }
>    - hAxis: { ticks: [new Date(2014,3,15), new Date(2013,5,15)] }
>    - hAxis: { ticks: [16, {v:32, f:'thirty two'}, {v:64, f:'sixty four'},
>    128] }
>
> Following these, I wrote these attempts on my var options but
> unfortunately they do not work.
>
> <!--hAxis: { ticks: [ new Date(2018,05,01),Date(2018,05,11) ] },-->
> <!--hAxis: { title: "Days", ticks: [{f:"2018-05-11", f:"2018-05-11"}] },-->
> <!--hAxis:{ticks: [ Date(2018,06,01), Date(2018,05,11) ]},-->
> <!--hAxis: {ticks: [{f:'2018-05-11'},{f:'2018-05-22'}]},-->
> hAxis: {ticks: ['2018-05-11','2018-05-22']},
>
> Any idea to fix this issue?
>
> Thanks in advance.
>
> Drigo
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to
> [email protected].
> Visit this group at
> https://groups.google.com/group/google-visualization-api.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-visualization-api/b4c344a1-6323-46ad-8c85-e73312cfef1a%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/b4c344a1-6323-46ad-8c85-e73312cfef1a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>
[email protected] <[email protected]>   5CC, Cambridge MA

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJOx%3Dmmf9SGYBM%2Bkg5-ZUxUXZHfPLR%3DypxDXB9-4AV1i0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to