-
Notifications
You must be signed in to change notification settings - Fork 570
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
Support for bubble charts #235
Comments
It's been supported on: https://github.com/ankane/chartkick.js Will work on implementing for chartkick |
Hey @lettergram, thanks for wanting to help with this. Right now, support for bubble charts in Chartkick.js is experimental, so don't think it makes sense to add it to Chartkick. |
@ankane Sounds good, is there something you could use help with? |
@lettergram thanks for offering. At the moment, I'm hesitant to add new chart types. The most common types are already covered and it increases maintenance. |
I am not sure of the status of bubble charts in Chartkick or Chartkick.js. Are they still experimental a year later? |
Seems to be available in Chart.js as well: http://www.chartjs.org/samples/latest/scriptable/bubble.html |
I know this issue is old, but I thought I would chime in with the hope of helping to put it to rest 😄 I achieved this with a simple monkey patch... module Chartkick
module Helper
def bubble_chart(data_source, **options)
chartkick_chart "BubbleChart", data_source, options
end
end
end I'd be happy to add this in a PR if people feel comfortable adding BubbleChart support now? One thing I found awkward was when grouping and counting with ActiveRecord, i.e. Model.group(:x, :y).count
# {[30, 70] => 1, [20, 70] => 1], [60, 40] => 1], [70, 30] => 1], [20, 20] => 1], [50, 50] => 2]} I would need to "flatten" the results, which I chose to do like so (for now)... Model.group(:x, :y).count.map { |k, v| k.concat([v]) }
# [[30, 70, 1], [20, 70, 1], [60, 40, 1], [70, 30, 1], [20, 20, 1], [50, 50, 2]] The reason I mention this is that I wonder if there should be a helper (another gem?) to help massage these kinds of results? |
I thought that was the point of extending |
I get it. However, I have to add -- three years later -- that a wrapper that has so many unimplementeds in it, suffers because of lack of confidence. There are umpteen different Google Charts in their API, and ChartKick does a PHENOMENAL job ... on <10. So it doesn't really act like "oh I can use this gem and easily work with Google Charts". Rather, it's "well as long as I only want to take on the easy low-hanging fruit, I can use the gem ....". I know it's a tough call balancing stuff out , but I've been working with it for around a week and I'm feeling the limitation. Can you give some details for how you are converting data on the Ruby side and outputting it as JS on the browser? Google's JS seems to want a set of data to start with the column names and then outputting the data as an array of arrays in the JS sent to the browser. It's unclear to me where you picked the column names off of and how you attached that to the data (on the Ruby side the ActiveRecord::Relation seems to want to resolve as a Hash, not an Array) |
Are there still plans to add this chart type? There's already a PR that implements it #411 |
Any chance you could add support for bubble charts? Google Charts and Highcharts support them, and I hope you can add them to your product roadmap.
Thanks.
The text was updated successfully, but these errors were encountered: