HOSTING

Share an amCharts chart as a link

An amCharts 5 chart draws in the browser, so it fits in one HTML file. Load amCharts from its CDN, put the data in the page, upload the file, and send a link that opens the working chart.

4 min read·

amCharts 5 draws charts on a canvas in the browser, with animation, tooltips and legends. A screenshot drops all of that, and a project that loads a separate data file breaks when the recipient opens it from disk, because a request for a local file is blocked on a file:// page.

One HTML file with amCharts loaded from its 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>, <meta charset="utf-8"> and <meta name="viewport" content="width=device-width, initial-scale=1"> in the head.
  • ✓Three script tags: https://cdn.amcharts.com/lib/5/index.js (the core), https://cdn.amcharts.com/lib/5/xy.js (bar, line and column charts) and, for animation, https://cdn.amcharts.com/lib/5/themes/Animated.js. Pie charts load percent.js instead of xy.js.
  • ✓A container with a height, such as <div id="chart" style="width:100%;height:400px"></div>. amCharts fills the container, so a container with no height draws nothing.
  • ✓A <script> block after the container that creates the root with am5.Root.new("chart"), pushes an am5xy.XYChart into root.container.children, adds a CategoryAxis, a ValueAxis and a ColumnSeries, and passes the rows to xAxis.data.setAll(data) and series.data.setAll(data).
  • ✓Tested on amCharts 5.21.5: three rows of { month: "Jan", signups: 12 } drew three columns labeled Jan, Feb and Mar. The value axis started at 10, not 0; add min: 0 to the ValueAxis settings for bars that start at zero.

Keep the data inside the page

A chart that loads its numbers with fetch("data.json") or am5.net.load() requests a second file. An uploaded page is hosted on its own, so that request fails and the chart stays empty.

Put the rows in the script as an array of objects, one object per category, with the field names you give the series as categoryXField and valueYField. A spreadsheet export can be pasted in the same way.

Data that already lives at a public URL which allows cross-origin requests can stay as a fetch() with the full https:// address. Call series.data.setAll() once the response arrives.

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, and viewers need no account.

If the page is blank once hosted, open the browser console. "am5 is not defined" means the index.js tag is missing or comes after your chart code; "am5xy is not defined" means xy.js is missing; 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.

cdn.amcharts.com/lib/5/ serves the latest 5.x release, so the chart picks up amCharts updates without a new upload. The free version draws a small amCharts logo in the corner of the chart; a commercial amCharts license removes it.

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.

Other chart libraries: Highcharts, ApexCharts, ECharts, Chart.js, Google Charts.

Frequently asked

How do I share an amCharts chart without a web server?

Put the amCharts script tags from cdn.amcharts.com, a container with a height, your chart code and the data into one HTML file, upload it to a host that serves HTML as a web page, and send the link.

Why is my amCharts chart blank after upload?

Usually the container has no height, a script tag such as xy.js is missing or loads after the chart code, or the data comes from a file that was not uploaded. Check the browser console for the exact error.

Does the shared chart keep its animation and tooltips?

Yes. The hosted page runs the same JavaScript as your local file, so the chart animates and shows tooltips the same way it does on your machine.

Is it free?

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.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free