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

Bubble Chart and Legend #8

Open
hairpin86 opened this issue Apr 26, 2018 · 2 comments
Open

Bubble Chart and Legend #8

hairpin86 opened this issue Apr 26, 2018 · 2 comments

Comments

@hairpin86
Copy link

Hi,

First of all, thanks for this great plugin. I have 2 questions regarding your implementation:

How did you get to show Bubble Charts like here : https://github.com/rte-antares-rpackage/leaflet.minichart/blob/master/img/bubblecharts.png ?

Did you just pass one value into the data array? But how come you can add a String to the data and still have a dyamic Bubble size?

How did you add the legend like here: https://github.com/rte-antares-rpackage/leaflet.minichart/blob/master/img/barcharts.png
?

@FrancoisGuillem
Copy link
Contributor

Hi,

My answer is a little late, but better late than never :D

Concerning question 1, you can pass a single number or an array of length 1 as data and set option "type" to "pie", "polar-radius" or "polar-area" and set "labels" to "auto". For instance:

L.minichart([0, 0], {data: 1234, type:"pie", labels:"auto"}).addTo(map)

gives:
image

Concerning the legend, it is not generated with this package. I have used the R package "leaflet" that generates interactive maps. It has a simple function "addLegend()" that generates the required javascript to display such legend.

@szkatalin
Copy link

There is a good tutorial for the legend here: https://leafletjs.com/examples/choropleth/

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