The [gravitycharts] Shortcode
The [gravitycharts] shortcode enables embedding a GravityCharts chart into post or page content.
How to Find Your Chart ID
Before using the shortcode, you need to know your chart's ID. There are two ways to find it:
Method 1: All Charts Page (Easiest)
- In your WordPress admin, go to GravityKit → All Charts
- The ID column shows each chart's ID number
Method 2: Individual Form Settings
- Go to Forms and hover over the form containing your chart
- Click Settings → Charts
- Click on the chart you want to embed
- Look at the URL in your browser - the ID appears at the end (e.g.,
...&subview=gravitycharts&id=5means the chart ID is 5)
Shortcode Parameters
The following parameters are available:
| Name | Description | Required? |
|---|---|---|
id |
The ID number of the chart (see above for how to find it) | Required |
height |
Define a maximum height (CSS max-height property) for the chart in pixels |
Optional |
width |
Define a maximum width (CSS max-width property) for the chart in pixels |
Optional |
embed_type |
To embed a static image instead of an interactive chart, set this to "image". Learn more: Image Charts | Optional |
entry |
To chart data from a single entry only, specify the entry ID | Optional |
Examples
Basic chart embed:
[gravitycharts id="5"]
Chart with maximum width:
[gravitycharts id="5" width="400"]
Image version of chart:
[gravitycharts id="5" width="400" embed_type="image"]
Chart showing data from entry #123:
[gravitycharts id="5" entry="123"]
Troubleshooting
Chart not appearing? Double-check that:
- The chart ID is correct (verify in GravityKit → All Charts)
- The chart is saved and configured properly with a data source
- You're using the shortcode on a published post or page
Other Ways to Embed Charts
The shortcode is one of three ways to embed GravityCharts. Learn more: How to Embed Charts on Your Site