Skip to content
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

TimeSeries not rendered if Ticks are set in XAxis #46

Open
fiatjaf opened this issue Jul 11, 2017 · 2 comments
Open

TimeSeries not rendered if Ticks are set in XAxis #46

fiatjaf opened this issue Jul 11, 2017 · 2 comments

Comments

@fiatjaf
Copy link

fiatjaf commented Jul 11, 2017

Without setting ticks:

module-linker

Setting ticks:

xaxis.Ticks = [{1.498608e+09 Jun 28} {1.4988672e+09 Jul 01} {1.4989536e+09 Jul 02} {1.49904e+09 Jul 03} {1.4991264e+09 Jul 04} {1.4992128e+09 Jul 05} {1.4992992e+09 Jul 06} {1.4993856e+09 Jul 07} {1.499472e+09 Jul 08} {1.4996448e+09 Jul 10} {1.4997312e+09 Jul 11}]

module-linker

(Note that the ticks are set to be exactly under each dot in the series.)

The full code is at https://github.com/fiatjaf/ght/tree/541f3b7ee589a45437091e6df0808b43b5d76e82

@wcharczuk
Copy link
Owner

are there any errors returned by https://github.com/fiatjaf/ght/blob/541f3b7ee589a45437091e6df0808b43b5d76e82/main.go#L279 i.e. the .Render() call? often that is my first place to look

@jamesfraser
Copy link

Hi @wcharczuk

I ran into this same issue - turns out the issue is related to the timeUtil.ToFloat64 method.
When using a time series, this method casts the the time value to float64(t.UnixNano()) whereas what I (and @fiatjaf did) was use t.Unix() in our ticks construction.

Had to run it under dlv before I could figure out what was going on.

Hope this helps - just needs a note in the documentation to resolve.

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

No branches or pull requests

3 participants