{"id":15958699,"url":"https://github.com/koooooo-7/echarts4j","last_synced_at":"2025-03-17T22:30:37.729Z","repository":{"id":247035147,"uuid":"817860798","full_name":"Koooooo-7/echarts4j","owner":"Koooooo-7","description":"🍩 An inevitable charts library for Java.","archived":false,"fork":false,"pushed_at":"2024-10-22T06:30:39.000Z","size":3618,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-23T09:21:19.444Z","etag":null,"topics":["data-visualization","echarts","java","visualization"],"latest_commit_sha":null,"homepage":"https://koooooo-7.github.io/echarts4j/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Koooooo-7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-20T15:34:13.000Z","updated_at":"2024-10-22T06:30:39.000Z","dependencies_parsed_at":"2024-10-23T02:33:00.013Z","dependency_job_id":null,"html_url":"https://github.com/Koooooo-7/echarts4j","commit_stats":{"total_commits":96,"total_committers":3,"mean_commits":32.0,"dds":"0.17708333333333337","last_synced_commit":"a3616004cd5b6af3b1287b61fdc9e27ff5e33b33"},"previous_names":["koooooo-7/echarts4j"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Koooooo-7%2Fecharts4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Koooooo-7%2Fecharts4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Koooooo-7%2Fecharts4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Koooooo-7%2Fecharts4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Koooooo-7","download_url":"https://codeload.github.com/Koooooo-7/echarts4j/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221701691,"owners_count":16866220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-visualization","echarts","java","visualization"],"created_at":"2024-10-07T14:20:29.017Z","updated_at":"2024-10-27T15:58:00.335Z","avatar_url":"https://github.com/Koooooo-7.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# echarts4j\n\n[![Release](https://jitpack.io/v/Koooooo-7/echarts4j.svg)](https://jitpack.io/#Koooooo-7/echarts4j/main-SNAPSHOT)\n![Echarts](https://img.shields.io/badge/echarts-_v5+-orange)\n![JDK](https://img.shields.io/badge/JDK-8+-blue)\n![License](https://img.shields.io/badge/License-Apache_2.0-brightgreen.svg)\n[![JavaDoc](https://img.shields.io/badge/JavaDoc-latest-yellow)](https://javadoc.jitpack.io/com/github/koooooo-7/echarts4j/echarts4j-project/main-SNAPSHOT/javadoc/index.html)\n\n\n\u003e Fairy tales are more than true: not because they tell us that dragons exist, but because they tell us that dragons can\n\u003e be beaten. —— Neil Gaiman, Coraline\n\nTo be honest, I believe using `Java` to build charts is a disaster, as it often feels like struggling in the explicit\ntyped hell, accompanied by lengthy lines of code. However, it also piques my interest in finding ways to approach it\nwith a more loosely coupled mindset (not just dumping everything as pure `Object`s 🐶). With increased experience in [Echarts](https://echarts.apache.org/) and discovering\nvarious tricks, I've become even more curious about the possibilities. Fortunately, I now have the time to delve into\nthis further. *( contents polished by `ChartGPT-4`)*\n\n---\n\n[README 中文](./README_ZH.md)\n\n### 🔰 Installation\n\n\u003e Support JDK8+ with `\"JDK Sympathy\"` (you do need upgrade it tho!)\n\nIt hosts on [jitpack](https://jitpack.io/#Koooooo-7/echarts4j/main-SNAPSHOT),\nyou can use the `main-SNAPSHOT` to fetch the latest version or the lock commit hash\nversion  [![Release](https://jitpack.io/v/Koooooo-7/echarts4j.svg)](https://jitpack.io/#Koooooo-7/echarts4j)\n.\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cstrong\u003eInstall via Gradle\u003c/strong\u003e\u003c/summary\u003e\n\n```gradle\nrepositories {\n    mavenCentral()\n    // add the repository\n    maven { url 'https://jitpack.io' }\n}\n\ndependencies {\n   implementation 'com.github.Koooooo-7.echarts4j:echarts4j-project:v1.0.0'\n}\n\n```\n\n\u003c/details\u003e\n\n\n\u003cdetails\u003e\n  \u003csummary\u003e\u003cstrong\u003eInstall via Maven\u003c/strong\u003e\u003c/summary\u003e\n\n```pom\n\u003crepositories\u003e\n    \u003crepository\u003e\n        \u003cid\u003ejitpack.io\u003c/id\u003e\n        \u003curl\u003ehttps://jitpack.io\u003c/url\u003e\n    \u003c/repository\u003e\n\u003c/repositories\u003e\n\t\n\u003cdependency\u003e\n    \u003cgroupId\u003ecom.github.Koooooo-7.echarts4j\u003c/groupId\u003e\n    \u003cartifactId\u003eecharts4j-project\u003c/artifactId\u003e\n    \u003cversion\u003ev1.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n\u003c/details\u003e\n\n### ✨ Features\n\n* Smooth builder APIs.\n* Highly configurable chart options.\n* Lots of beauty charts available.\n* Closely to the full Echarts functionalities.\n* Strong Extensibility.\n* Live update support for displaying (see [echarts4j-chart-server](./echarts4j-chart-server/README.md)).\n* Snapshot for image render (see [echarts4j-snapshot-playwright](./echarts4j-snapshot-playwright/README.md)).\n* And more.\n\n### 🎨 Showcase\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"docs/assets/line-sample.png\" width=\"25%\" alt=\"line\"/\u003e\n\u003cimg src=\"docs/assets/bar.png\" width=\"25%\" alt=\"bar\"/\u003e\n\u003cimg src=\"docs/assets/candlestick.png\" width=\"22%\" alt=\"candlestick\"/\u003e\n\u003cimg src=\"docs/assets/overlap.png\" width=\"24%\" alt=\"overlap\"/\u003e\n\u003cimg src=\"docs/assets/dynamic-pie.png\" width=\"26%\" alt=\"dynamic-pie\"/\u003e\n\u003cimg src=\"docs/assets/funnel.png\" width=\"23%\" alt=\"funnel\"/\u003e\n\u003cimg src=\"docs/assets/tree.png\" width=\"22%\" alt=\"tree\"/\u003e\n\u003cimg src=\"docs/assets/effectscatter.png\" width=\"26%\" alt=\"effectscatter\"/\u003e\n\u003cimg src=\"docs/assets/sunburst.png\" width=\"25%\" alt=\"sunburst\"/\u003e\n\u003cimg src=\"docs/assets/radar.png\" width=\"24%\" alt=\"radar\"/\u003e\n\u003cimg src=\"docs/assets/liquidfill.png\" width=\"24%\" alt=\"liquidfill\"/\u003e\n\u003cimg src=\"docs/assets/wordcloud.png\" width=\"24%\" alt=\"wordcloud\"/\u003e\n\u003cimg src=\"docs/assets/cow.png\" width=\"50%\" alt=\"cowboy\"/\u003e\n\u003c/div\u003e\n\n---\n\n### 📝 RunBook\n\nIn a nutshell, it generates [Apache Echarts](https://echarts.apache.org/) options for the Echarts instance.\nIf you already familiar with [Echarts](https://echarts.apache.org/), you can quickly dive in.\n\n- Take a quick look at the [Echarts Demos](https://echarts.apache.org/examples/en/index.html) to find what you need.\n- Refer to the available [Echarts Options](https://echarts.apache.org/en/option.html#title) to understand how to\n  configure.  \n  (If it is missing in `echarts4j`, feel free to raise an Issue/PR :rocket:)\n\nIn general, there are three key aspects to understand about building an Echarts Chart in `echarts4j`:\n\n- The `Canvas`, which contains all the charts and resources (`js, css...`), functioning similarly to an HTML page by\n  default.\n- The `Chart`, representing a Chart instance, with generic chart configurations, such as Title, Toolbox, and more.\n- The `Series`, which resides within the Charts, where each type of Series indicates the underlying chart type.\n\n```\n|————————————  \n|  Canvas   |  \n|           |  \n|  ——————   |  \n|  | Chart  |  \n|  |  ————  |  \n|  |    |Series type=Bar |\n|  |  ————  |  \n|  |    |Series type=Line| \n|       (overlap different kinds of charts in one Chart)\n|  |  ————  |  \n|  |    |Series ... | \n|  |  ————  |  \n|  ——————   |\n| Charts...|\n|  ——————   |\n|  ——————   |\n|  ——————   |\n ———————————\n\n```\n\nMore details please see the [QuickStart](https://koooooo-7.github.io/echarts4j/#/QuickStart) and\nthe [JavaDoc](https://javadoc.jitpack.io/com/github/koooooo-7/echarts4j/echarts4j-project/main-SNAPSHOT/javadoc/index.html)\n, and the test cases also.\n\n---\n\n### 📊 Usage\n\n\u003e Basic Chart\n\n\u003cimg src=\"./docs/assets/bar.png\" alt=\"line\"\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eCode\u003c/summary\u003e\n\n```\n        final String chartTitle = \"My First echarts4j Bar\";\n        final String legendFormatter = \"'Top: {name}'\";\n        final String seriesName = \"Cole\";\n        final String seriesName2 = \"Peps\";\n\n        try {\n            Canvas.builder()\n                    .addCharts(BarChart.builder()\n                            .options(ChartOption.builder()\n                                    .title(Title.builder()\n                                            .text(chartTitle).build())\n                                    .legend(Legend.builder()\n                                            .formatter(FuncStr.of(legendFormatter)).build())\n                                    .toolbox(Toolbox.builder()\n                                            .showTitle(true)\n                                            .feature(Toolbox.Feature.builder()\n                                                    .saveAsImage(Toolbox.SaveAsImage.builder().build())\n                                                    .restore(Toolbox.Restore.builder().build())\n                                                    .dataView(Toolbox.DataView.builder().build())\n                                                    .build())\n                                            .build())\n                                    .xAxis(XAxis.builder()\n                                            .data(x)\n                                            .build())\n                                    .yAxis(YAxis.builder().build())\n                                    .build()\n                                    .addSeries(BarChartSeries.builder()\n                                            .name(seriesName)\n                                            .data(data1)\n                                            .markLine(MarkLine.builder()\n                                                    .data(Arrays.asList(MarkLine.MarkLineDataItem.builder()\n                                                                    .name(\"The Max\")\n                                                                    .type(\"max\")\n                                                                    .build(),\n                                                            MarkLine.MarkLineDataItem.builder()\n                                                                    .name(\"The Min\")\n                                                                    .type(\"min\")\n                                                                    .build()))\n                                                    .build())\n                                            .build())\n                                    .addSeries(BarChartSeries.builder()\n                                            .name(seriesName2)\n                                            .data(data2)\n                                            .build())\n                            )\n                            .build())\n                    .build()\n                    .renderTo(new File(\"bar.html\"));\n\n```\n\n\u003c/details\u003e\n\n---\n\u003e Overlap Charts\n\n\u003cimg src=\"./docs/assets/overlap.png\" alt=\"overlap\" /\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eCode\u003c/summary\u003e\n\n```\n        final String chartTitle = \"My Overlap Charts\";\n        final String seriesName = \"seriesName\";\n        final String seriesName2 = \"seriesName2\";\n        final LineChart c = LineChart.builder()\n                .options(ChartOption.builder()\n                        .title(Title.builder()\n                                .text(chartTitle).build())\n                        .legend(Legend.builder().build())\n                        .xAxis(XAxis.builder()\n                                .data(x)\n                                .build())\n                        .yAxis(YAxis.builder().build())\n                        .build()\n                        .addSeries(ListChartSeries.builder()\n                                .name(seriesName)\n                                .data(data1)\n                                .build())\n                        .addSeries(BarChartSeries.builder()\n                                .name(seriesName2)\n                                .data(data2)\n                                .build())\n                )\n                .build();\n\n        final Canvas cvs = Canvas.builder()\n                .addCharts(c)\n                .build();\n        final Render render = RenderProvider.get();\n        render.render(cvs, new FileWriter(\"overlap.html\"));\n\n    }\n```\n\n\u003c/details\u003e\n\n---\n\n\u003e Dynamic Chart with Event and Action.\n\n\u003cimg src=\"./docs/assets/dynamic-pie.gif\"  alt=\"dynamic-pie\"/\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eCode\u003c/summary\u003e\n\n```\n final String chartTitle = \"Dynamic Pie\";\n    final String seriesName = \"Access Source\";\n\n    final List\u003cString\u003e legendData = Arrays.asList(\n            \"Direct Access\",\n            \"Email Marketing\",\n            \"Affiliate Ads\",\n            \"Video Ads\",\n            \"Search Engines\"\n    );\n\n    final DataHelper dataHelper = DataHelper.create()\n            .addValueField(Integer.class)\n            .addNameField()\n            .build()\n            .addData(335, \"Direct Access\")\n            .addData(310, \"Email Marketing\")\n            .addData(234, \"Affiliate Ads\")\n            .addData(135, \"Video Ads\")\n            .addData(1548, \"Search Engines\");\n\n    final List\u003cString\u003e center = Arrays.asList(\"50%\", \"60%\");\n    final PieChart p = PieChart.builder()\n            .options(ChartOption.builder()\n                    .animation(false)\n                    .title(Title.builder()\n                            .text(chartTitle)\n                            .right(\"20\")\n                            .build())\n                    .legend(Legend.builder()\n                            .orient(\"vertical\")\n                            .left(\"left\")\n                            .data(legendData)\n                            .build())\n                    .build()\n                    .addSeries(PieChartSeries.builder()\n                            .name(seriesName)\n                            .radius(\"55%\")\n                            .center(center)\n                            .data(dataHelper.get())\n                            .build())\n            )\n            .build()\n            .addJSFunction(FuncStr.of(actionWithEchartsInstance))\n            .addListener(\"'click'\", FuncStr.of(clickAlterFunc))\n            .addListener(\"'legendselectchanged'\", FuncStr.of(legendClickAlterFunc))\n            .addListener(\"'mousemove'\", FuncStr.of(\"{ dataIndex: 3 }\"), FuncStr.of(mouseMoveAlterFunc));\n\n        Canvas.builder()\n                .addCharts(p)\n        .build()\n        .renderTo(new File(\"dynamic-pie.html\"));\n```\n\n\u003c/details\u003e\n\n---\n\n### 🚀 Contribution\n\n- New feature and bug fix are both great.\n- Issue driven or PR driven is better.\n- Options enrichment is highly welcome.\n\n---\n\n### 🎉 Special Thanks\n\nGratitude to all outstanding projects/libraries for their contributions in echarts4j.\n\n### 📃 License\n\nApache-2.0 license [©KoyZhuang](https://github.com/Koooooo-7/echarts4j/blob/main/LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoooooo-7%2Fecharts4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkoooooo-7%2Fecharts4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkoooooo-7%2Fecharts4j/lists"}