Open margin555 opened 5 years ago
@margin555
Unfortunately, the current version of the library doesn't provide a listener on multiple selections, only on a single click/select.
The snippet below describes how to achieve that (the map file is placed in app assets, getData()
returns the series data:
Map map = AnyChart.map();
map.geoData("anychart.maps.united_states_of_america");
Choropleth series = map.choropleth(getData());
map.setOnClickListener(new ListenersInterface.OnClickListener(new String[]{"id", "name", "value"}) {
@Override
public void onClick(Event event) {
event.getData().get("id");
event.getData().get("name");
event.getData().get("value");
Log.d("MapListener", event.getData().get("id"));
}
});
anyChartView.addScript("file:///android_asset/united_states_of_america.js");
anyChartView.addScript("file:///android_asset/proj4.js");
anyChartView.setChart(map);
In Choropleth Map how can I detect the clicked state (states in the US) and also how can I enable multiple states click