- Notifications
You must be signed in to change notification settings - Fork70
Open
Description
Hey, thanks for the nice project,
Request
Are GEO/map chart supported ? I couldn't find a MapSeries.
I'd like to reproduce this example:
https://echarts.apache.org/examples/en/editor.html?c=map-usa
Workaround
For the moment I implement a SeriesOption that looks like this:
public static class MapSeriesOption implements SeriesOption { private String type = "map"; private String name; private boolean roam; private String map; private Map<String, Object> emphasis; private Object data; public MapSeriesOption(...) { this.name = "SOME_NAME"; this.roam = true/false; // map chart specific ! this.map = "myMapName"; // map chart specific ! this.emphasis = emphasisConfig // eg Map.of("label", Map.of("show", true)); // some things specific to map chart ? this.data = data; } // implement all setters (I actually don't use them so I let the IDE generate unused methods)}Then I can use the Option interface:
new Option() .setTitle() .setToolTip ... .setSeries(new SeriesOption[]{new MapSeriesOption(...)});// then I get the json and use it in my system String optionJson = new EChartsSerializer().toJson(option)Note: this is just a quick workaround to get things done in my project, it does not fully implement the map charts parameters. The fluent pattern with setters would be better of course.
Metadata
Metadata
Assignees
Labels
No labels