Pie Chart with Legend
Legends are great for adding context to charts and can even replace labels in busier visualizations. Additionally, in amCharts legend items can act as toggles for the series in the chart (try clicking on the legend in this demo). And you get all of that functionality with no extra code.
Key implementation details
We just add a Legend to the chart’s children and then set data on it to our series data. And that’s it.
Related tutorials
Build this chart with AI
The prompt below can be used to build this chart with AI. For best coding results, use the most advanced AI models, like Claude Opus 4.6 and GPT-5.3-Codex. For more info and tips, check out amCharts AI docs.
Create a pie chart with seven data categories ('One' through 'Seven', values 10 down to 1) and a clickable legend positioned horizontally centered below the chart. The legend items should toggle the visibility of their corresponding pie slices when clicked. Include an animated sequential entrance on load. Each slice should have a distinct color and display labels around the pie. The chart should be responsive at 100% width and 500px height. Use amCharts 5 library.
Demo source