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

Charts not visible #101

Closed
scarroll32 opened this issue Nov 8, 2016 · 5 comments
Closed

Charts not visible #101

scarroll32 opened this issue Nov 8, 2016 · 5 comments

Comments

@scarroll32
Copy link

I'm on Rails 5 -- rails (5.0.0.1), no console errors but no chart at all.

screen shot 2016-11-08 at 09 45 59

(Note I have temporarily rolled back the changes I described in #50, so am using Blazer, I think, out of the box)

@ankane
Copy link
Owner

ankane commented Nov 8, 2016

Hey @seanfcarroll, please read the docs before filing issues: https://github.com/ankane/blazer#line-chart

@ankane ankane closed this as completed Nov 8, 2016
@scarroll32
Copy link
Author

Hi there, thanks for the quick response. I think I am being dumb ... I have a count in my query, but no chart appears

Charts

Blazer will automatically generate charts based on the types of the columns returned in your query.

Line Chart

2+ columns - timestamp, numeric(s) - Example

SELECT count(*), date_trunc('day',submission_time) FROM submissions s group by  date_trunc('day',submission_time)

@scarroll32
Copy link
Author

scarroll32 commented Nov 8, 2016

OK I found the problem. The submission_time field is timestampz ie: timestamp with timezone (on Postgres). When I run against a timestamp field eg: created_at, it works.

@ankane
Copy link
Owner

ankane commented Nov 11, 2016

Sorry @seanfcarroll, think I was in a bad mood on Monday. Both timestamp and timestamptz should work. The time column must come first, then the numeric. I'll make the docs more clear.

@scarroll32
Copy link
Author

scarroll32 commented Nov 11, 2016

Hey @ankane no problem. This is a great gem, and I'll soon do some work to help you out. I can start with #97 and perhaps also #98.

I think it would be great to able to drop Blazer into an existing Rails app, also noted here #49 and here #50

I have included it into an app, but needed to hack the layout a bit to include it in the same layout. Different engines approach the problem in different ways. I think the Devise approach is the gold standard, for gems without much markup or structure. I also like the Thredded approach including the ability to override the layout from the initializer.

The other thought I had was to add an advanced chart, where the user can write the SELECT first, then chose from the returned columns for x and y axis on a chart.

I can start working on some or all of these. My own project is crowdAI and we will probably add Blazer into here also.

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

2 participants