Skip to content

Inconsistency when setting tickvals and omitting ticktext in date axes #738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stakemura opened this issue Jul 12, 2016 · 7 comments
Closed
Labels
bug something broken community community contribution
Milestone

Comments

@stakemura
Copy link

Please see https://jsfiddle.net/0cjprqgy/10/
All ticks of date axis display as "hh:mm:ss aN".

@etpinard
Copy link
Contributor

That's probably because your tickvals aren't valid date timestamps.

How did you get those values?

@stakemura
Copy link
Author

In real use case, I used programmaticaly-generated date timestamps.
However, all cases seemed to be failed.
OK. the following new sample use apparently valid timestamps.
How about https://jsfiddle.net/0cjprqgy/11/ ?

@etpinard
Copy link
Contributor

Looks like those weird tick labels are caused by you not providing a ticktext setting to accompany tickvals. Setting a proper ticktext makes your problem go away http://codepen.io/etpinard/pen/YWEdJX .

But, those weird labels do showcase an inconsistency between linear and date axis types. See http://codepen.io/etpinard/pen/rLYoqK here omitting to provide ticktext falls back to stringnified tickvals values - making this issue a very low priority bug.

Maybe a better question to ask ourselves: should we allow tickmode: 'array' when tickvals isn't provided? I'm changing the issue title to reflect this. Thanks.

@etpinard etpinard changed the title tickvals has display bug on date axis Inconsistency when setting tickvals and omitting ticktext in date axes Jul 13, 2016
@etpinard etpinard added bug something broken community community contribution labels Jul 13, 2016
@stakemura
Copy link
Author

Thank you for your consideration.
I tried tickvals with ticktext actually but I found the different problem.
Like http://codepen.io/etpinard/pen/YWEdJX , hover text won't be able to show date.
I guess hover text on date axis show date and time fundamentally.
What makes this difference?

@etpinard
Copy link
Contributor

hover text won't be able to show date.

You mean it only shows the hour? Interesting. Thanks for pointing this out. This is probably related to the inconsistency mentioned in #738 (comment)

@etpinard etpinard reopened this Jul 13, 2016
@stakemura
Copy link
Author

Without tickvals date axis shows date and time apparently.
Please check https://jsfiddle.net/0cjprqgy/12/ .

@etpinard
Copy link
Contributor

Without tickvals date axis shows date and time apparently

Yeah I noticed that too. This should be resolved in the same patch as for #738 (comment)

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken community community contribution
Projects
None yet
Development

No branches or pull requests

2 participants