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

How to change the text 'Value' in Chartkick's geochart #189

Closed
bnussey opened this issue May 27, 2015 · 4 comments
Closed

How to change the text 'Value' in Chartkick's geochart #189

bnussey opened this issue May 27, 2015 · 4 comments

Comments

@bnussey
Copy link

bnussey commented May 27, 2015

I am rendering a geochart with the following:

<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>

<%= geo_chart Company.group(:country).count, colors: ["#33C1FF", "#008ED6"] %>

This works great, but the text used on the map to specify the count for each country is 'Value'.

I am using the Google Charts API to do this, and looking at their documentation, they are able to use 'Popularity' instead of 'Value' by doing this:

var data = google.visualization.arrayToDataTable([
      ['Country', 'Popularity'],
      ['Germany', 200],
      ['United States', 300],
      ['Brazil', 400],
      ['Canada', 500],
      ['France', 600],
      ['RU', 700]
    ]);

I've tried to replicate this by adding it directly to geo_chart, and still 'Value' appeared. You can see my attempt below:

<%= geo_chart [['Popularity'], ['Germany', 200], ['United States', 300], ['Brazil', 400], ['Canada', 500], ['France', 600], ['RU', 700]], colors: ["#33C1FF", "#008ED6"] %> 

Any ideas?

Thanks

@alanchavezgar
Copy link

#46

@bnussey
Copy link
Author

bnussey commented Aug 20, 2015

Hey @alanchavezgar thanks for that.. Do you know if that works for the geomap as well? Looks like it's for highcharts

@ankane
Copy link
Owner

ankane commented Feb 29, 2016

This is now possible with the label option.

@ankane ankane closed this as completed Feb 29, 2016
@juanroldan1989
Copy link

Hello @ankane is also possible to customize Geo Charts with the label option ? I can't find docs about it. Thanks for any advise here : )

@lock lock bot locked as resolved and limited conversation to collaborators Dec 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants