- Components
- Pie chart
- Legend
Legend Pie Chart
Name every slice in a side legend when labels are too long to fit on the pie — perfect for OG images, with data set per API call. Try imejis free.
Updated

What this style sets
A style is the pie chart component with a few properties set. Send these, or start from the style in the editor.
{
"share.showValues": false,
"share.showLegend": true,
"share.legendPosition": "right"
}Good for
- OG images where slice labels would overflow
- Reports with longer category names
- Small charts that need to stay readable
Try your own data
Change the legend pie chart here with the same controls the editor shows. The preview updates as you type, and you get the API request for your changes.
Examples
Each example is the same legend pie chart with different values. The JSON is what you send.
Acquisition channels OG image
Traffic share with channel names in a right-hand legend instead of on the slices.
{
"share.showValues": false,
"share.showLegend": true,
"share.legendPosition": "right",
"share.data": [52, 23, 15, 10],
"share.labels": ["Organic", "Paid search", "Referral", "Email"],
"share.colors": ["#6366F1", "#F59E0B", "#0EA5E9", "#10B981"]
}Ad spend by platform
Quarterly ad budget share across four platforms on a dark canvas.
{
"share.showValues": false,
"share.showLegend": true,
"share.legendPosition": "right",
"share.data": [45, 30, 15, 10],
"share.labels": ["Google Ads", "Meta", "LinkedIn", "TikTok"],
"share.colors": ["#0EA5E9", "#6366F1", "#10B981", "#F472B6"],
"share.textColor": "#E2E8F0"
}New values, every render
Update slice values with '<key>.data' and names with '<key>.labels'; variant and colors are overridable too. Send only the properties you want to change; everything else keeps its design value. The API guides cover every language.
curl -X POST "https://render.imejis.io/v1/$IMEJIS_DESIGN_ID" \
-H "dma-api-key: $IMEJIS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"share.data": [55, 20, 15, 10],
"share.showValues": false,
"share.showLegend": true,
"share.legendPosition": "right"
}' \
-o image.pngconst res = await fetch(`https://render.imejis.io/v1/${process.env.IMEJIS_DESIGN_ID}`, {
method: "POST",
headers: {
"dma-api-key": process.env.IMEJIS_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"share.data": [55, 20, 15, 10],
"share.showValues": false,
"share.showLegend": true,
"share.legendPosition": "right"
}),
})
if (!res.ok) throw new Error(`render failed: ${res.status}`)
const image = Buffer.from(await res.arrayBuffer())import os
import requests
response = requests.post(
f"https://render.imejis.io/v1/{os.environ['IMEJIS_DESIGN_ID']}",
headers={
"dma-api-key": os.environ["IMEJIS_API_KEY"],
"Content-Type": "application/json",
},
json={
"share.data": [55, 20, 15, 10],
"share.showValues": False,
"share.showLegend": True,
"share.legendPosition": "right"
},
)
response.raise_for_status()
with open("image.png", "wb") as f:
f.write(response.content)Other pie chart styles
Legend Pie Chart questions
What does the Legend style change on the pie chart component?
Slice names in a side legend — for labels that will not fit on the pie. It sets 3 properties on the pie chart component: showValues, showLegend, legendPosition. Everything else keeps the component's defaults, so your data and layout carry over.
How do I render the legend pie chart through the API?
Add a pie chart component to a design, then send its data together with the style's properties as flat overrides (for example share.showValues and share.showLegend) in the render request. Each render can carry different data while keeping the Legend look.
Can I change the slices per API call?
Yes — '<key>.data' sets the slice values and '<key>.labels' the names; colors and the pie/donut variant are overridable too.
How do I make a donut chart?
Set variant to 'donut' and tune innerRadius (a fraction of the pie radius) to size the hole — leaving room for a centered metric.
Where the pie chart component fits
Free tools built on it, guides that use it, and the components that sit beside it.


