Embed a Chart in Ghost
Add live data charts to Ghost posts and pages
Ghost is built for publications and newsletters, where a chart gives readers the numbers behind a story. An InstaCharts chart goes into an HTML card, and readers on your site can hover over it, switch to a data table and export the data.
- Live and interactive
- Updates when your data changes
- Free plan available
Stock Price Trend
Live
A live line chart embedded with InstaCharts, the kind of chart you can add to Ghost. Hover over the chart to see each value.
Open TemplateAt a glance
What you need to embed a chart in Ghost
An InstaCharts chart shared publicly, its Responsive Embed Tag, and a HTML card on your Ghost page.
Code to copy
Responsive Embed Tag
Where it goes in Ghost
HTML card
Updates
Automatic when the chart or its data changes
About Ghost
What is Ghost?
Ghost is an open source publishing platform for blogs, newsletters and paid memberships, launched in 2013 and run by the nonprofit Ghost Foundation. Publishers can host it themselves or use the managed Ghost(Pro) service, and each post can go out on the web and by email.
Visit ghost.orgChart ideas
Charts that work well in Ghost
Start from a template with sample data, then replace the rows with your own numbers and embed the chart in Ghost.
Market and price trends
Plot a stock or price series in a finance newsletter so readers can explore each point.
See the line chart templateBusiness reporting
Compare revenue by region and quarter in an analysis post.
See the grouped bar chart templateReader sentiment
Track a Net Promoter Score from reader surveys over time.
See the line chart templateIn InstaCharts
Make the chart and copy its embed code
Step 1
Add your data
Upload a CSV or Excel file, paste a table, import a file from a web link or connect a Google Sheet. InstaCharts reads your columns and suggests a chart.
To add a new sheet, launch the Add New Sheet dialog. There's a few ways to import your data, the easiest is Blank Sheet. In the empty spreadsheet on the Blank Sheet page, paste in your data straight from Excel. Click Next to see a data preview, then click Import. InstaCharts then draws a chart from the data automatically.
Step 2
Pick and style the chart
Choose the chart type and the columns for each axis, then set the title, colors and labels. Charts made from a synced Google Sheet or web link keep updating.
Easily change the shape of the chart using the Chart Type dropdown. Here, we are changing from a bar chart to a pie chart. Use the right click menu to show data labels on the pie chart, and to hide the legend. Finally we will change the chart theme and color scheme to get our chart to match our website.
Step 3
Share it and copy the Responsive Embed Tag
Click Share on the toolbar, choose Share Chart and set the share mode to Public. Under Embed in a webpage, choose Responsive next to Embed Tag and copy the code.
Click Share on the toolbar to open the Share & Templates dialog. Change the pie chart's share mode to Public. Under the Embed in a webpage tab, keep Responsive selected and copy the embed code.
In Ghost
Add the chart to Ghost
Paste the Responsive Embed Tag into a HTML card.
- 4
Step 4
Add an HTML card
In the Ghost editor, click the plus button on an empty line, or type /html, and choose the HTML card.
- 5
Step 5
Paste the Embed Tag
Paste the Responsive Embed Tag from InstaCharts into the card, then click outside the card to close its editor.
- 6
Step 6
Preview and publish
Click Preview to check the chart, then publish or update the post.
What the Responsive Embed Tag looks like
Copy your own code from the Share dialog. YOUR_CHART_ID stands for the id InstaCharts gives your chart.
<div class="instacharts-embed" data-src="embeds/YOUR_CHART_ID" style="width:600px; max-width:100%;">
<iframe src='https://instacharts.io/app/embeds/YOUR_CHART_ID' title="Quarterly Revenue" width="100%" height="600px" style="border-radius:6px; border: 1px solid rgba(0, 0, 0, 0.1); background:#ffffff;" frameborder="0" data-responsive="1"></iframe>
<script src="https://instacharts.io/app/scripts/embed.js" ></script>
</div>Tips
Tips for charts in Ghost
- Email clients block iframes, so newsletter readers see the interactive chart when they open the post on your site. For the email itself, add a shared chart image from the Share Image tab, which updates when the chart changes.
- Ghost themes set a content width for posts. Use the Customize toggle in the Share dialog to set the Embed Tag's width to that width or smaller.
- Turn on SEO caption to put the chart's title and a description of its data below the chart, where search engines index it with the post.
FAQ
Embedding charts in Ghost: FAQ
Answers to common questions about adding InstaCharts charts to Ghost.
Will the chart show in my Ghost newsletter?
Email clients block iframes, so the interactive chart shows in the web version of the post. Add a shared chart image to the post for email readers. It is a PNG that InstaCharts regenerates when the chart changes, and each new image counts as one task.
Can I keep the chart on my Ghost site only?
Yes, on paid plans. Turn on Domain Whitelisting in the Settings tab of the Share dialog and add your Ghost domain. Turn off Allow Top Level Loading as well so the chart only loads inside your site.
Does an embedded chart update when my data changes?
Yes. The embed loads the chart from InstaCharts each time the page opens, so changes to the chart and new data from a synced Google Sheet, a web link or Zapier show up with no new embed code.
Is it free to embed a chart?
Yes. The free plan includes 200 share and embed views a month, and free charts show an InstaCharts watermark. Paid plans remove the watermark and raise the limit to 1,000 views a month on Starter and 100,000 on Pro.
Can I embed a data table or a dashboard?
Yes. Turn on Full Dataset or Plotted Data in the Settings tab of the Share dialog to add sortable table views to the chart embed. Dashboards have their own Share dialog with an Embed URL and Embed Tag.
Can I see where my chart is embedded?
Yes, on paid plans. The Analytics tab of the Share dialog counts embed views apart from share link views and lists the top pages that load the chart.
Want the full reference?
Read the embed charts documentation for sizing, the embed toolbar, SEO options and domain whitelisting.
Explore
Embed a chart on another platform
Step by step guides for every website builder and app InstaCharts covers.
- Embed a Chart in Notion
- Embed a Chart in WordPress
- Embed a Chart in Webflow
- Embed a Chart in Wix
- Embed a Chart in Squarespace
- Embed a Chart in Shopify
- Embed a Chart in Bubble
- Embed a Chart in Google Sites
- Embed a Chart in Framer
See which embed code each platform needs on the embed a chart page.
Make a chart for your Ghost page
InstaCharts makes data visualization easy, so you can build clear reports without design experience.