undefined method `group' for #
error with
using mongoid 3, Pixel embeds_many Hits, Hit embedded_in Pixel. referrer is a string field of a Hit.41–50 of 64 posts
undefined method `group' for #
error with
using mongoid 3, Pixel embeds_many Hits, Hit embedded_in Pixel. referrer is a string field of a Hit.Hmm. I'm getting a undefined method `group' for # error with using mongoid 3, Pixel embeds_many Hits, Hit embedded_in Pixel. referrer is a string field of a Hit.
The ruby wrapper lib around the JS is dead simple. Could be ported to any language with ease. Very nice work! https://github.com/ankane/chartkick/blob/master/lib/chartkic...
https://github.com/agiliq/django-graphos
I am going to pick up some ideas from your code.
Hmm. I'm getting a undefined method `group' for # error with using mongoid 3, Pixel embeds_many Hits, Hit embedded_in Pixel. referrer is a string field of a Hit.
#group is an Arel method that generates a SQL 'GROUP BY' clause in the resulting statement, not part of chartkick or mongoid.
Earlier quoted context omitted.
#group is an Arel method that generates a SQL 'GROUP BY' clause in the resulting statement, not part of chartkick or mongoid.
it'd be nice to get a heads up that this was dependent on using a SQL database.
Earlier quoted context omitted.
#group is an Arel method that generates a SQL 'GROUP BY' clause in the resulting statement, not part of chartkick or mongoid.
it'd be nice to get a heads up that this was dependent on using a SQL database.
pie_chart @pixel.hits.group_by{|u| u.referrer }.each_with_object({}) {|(k,v), h| h[k] = v.size }Earlier quoted context omitted.
Why should the controller be generating graphics? The UI can do that.
Depending upon the number of data points you are representing, images may take less bandwidth and transfer time than the data itself. For example suppose you have a chart showing network latency; if you sample once a minute and show a month's worth of data you could easily transfer around 500KB for the raw data (assuming 12 bytes of json per sample), while an image file would be 20KB. If you have a dashboard full of…
If you want zoomable charts to allow for increasing resolution, then the chart lib should ask the controller for a specific resolution and range on demand.
Even then, 500KB of numeric JSON data compresses really well (I tested with 1 month of real-world per-minute data: 92KB).
Assuming the data for the graph shown is the dots, then the lines between them should be straight, not curved, because othrwise the graph is pretending to have higher accuracy than it actually has, which is a lie.
it's called interpolation.