Share an ECharts or pyecharts chart as a link
An Apache ECharts chart runs in the browser, so it fits in one HTML file. Load ECharts from a CDN, keep the option object and data in the page, upload the file, and send a link that opens the interactive chart. pyecharts writes that file for you.
ECharts draws tooltips, legend toggles and data zoom in the browser. A screenshot drops all of them, and a project folder with a separate data file breaks when the recipient opens it from disk, because a fetch() for a local file is blocked on a file:// page.
One HTML file with ECharts loaded from a CDN and the data inside it, hosted at a link, opens the working chart on any device.
Put the chart in one file
Create chart.html with this structure:
- ✓<!doctype html> and <meta charset="utf-8"> in the head.
- ✓<script src="https://cdn.jsdelivr.net/npm/echarts@6.1.0/dist/echarts.min.js"></script> to load ECharts. Pinning the version keeps the chart from changing when a new release ships.
- ✓A container with a height, such as <div id="chart" style="width:100%;height:420px"></div>. ECharts draws nothing into a container whose height is 0.
- ✓A <script> block after the container: const chart = echarts.init(document.getElementById("chart")); chart.setOption({ xAxis: { data: [...] }, yAxis: {}, tooltip: {}, series: [{ type: "bar", data: [...] }] });
- ✓Add window.addEventListener("resize", () => chart.resize()) so the chart fits a phone screen.
Move the data inside the page
A chart that loads data with fetch("data.json") requests a second file. An uploaded page is hosted on its own, so that request fails and the container stays empty.
Put the rows in the option object, or in a dataset: { source: [ … ] } block, inside the script. Data that already lives at a public URL which allows cross-origin requests can stay as a fetch() with the full https:// address.
From Python with pyecharts
pyecharts builds the same page from Python. chart.render("chart.html") writes one HTML file with the option object and data inline, and a script tag that loads echarts.min.js from assets.pyecharts.org.
To load ECharts from jsDelivr instead, set the host before rendering: from pyecharts.globals import CurrentConfig, then CurrentConfig.ONLINE_HOST = "https://cdn.jsdelivr.net/npm/echarts@6.1.0/dist/". Tested on pyecharts 2.1.0.
Charts that use maps or extra themes load more scripts from the same host. Keep those on a public host too, not on your disk.
Upload it and send the link
Drag the .html file onto the FileShare Pro dashboard and copy the link. The chart draws when the page opens. Tooltips, legend toggles and data zoom work as they did locally, and viewers need no account.
If the page is blank once hosted, open the browser console. "echarts is not defined" means the script tag is missing or comes after your chart code; a failed request for a .json or .csv file means data was left outside the page. Why an AI page works in chat but breaks when hosted covers charts an assistant wrote.
Turn on comments and viewers can leave a note on the page after typing a name. When the numbers change, upload the new file over the old one and the link stays the same: updating a shared link without changing it.
Frequently asked
Put a script tag that loads ECharts from a CDN, a container with a height, your setOption code and the data into one HTML file, upload it to a host that serves HTML as a web page, and send the link.
Usually the container has no height, the ECharts script tag is missing, or the data is fetched from a file that was not uploaded. Check the browser console for the exact error.
Yes, as long as the viewer is online. The file holds the chart options and data, and loads echarts.min.js from a public host.
Yes. The free plan hosts up to 50 files of up to 100 MB each, with view counts and comments included. Password-protected links are on Pro.
Drop the file, copy the link — live in seconds, free plan included.
Start sharing free