Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Support for GEO/Map charts #100

Open
@cyrilou242

Description

@cyrilou242

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp