Pyramid Chart
A demo of amCharts 4, the previous version. See it in amCharts 5.
Pyramid Chart represents a single data series with values displayed as parts of a whole in a triangular shape. Due to its shape, it is often used to display hierarchically related data items. Conceptually, Pyramid chart is the inverse version of a Funnel chart.
This is the amCharts 4 version. See this demo in amCharts 5
Open in:
Code
JavaScript
// Themes begin
am4core.useTheme(am4themes_animated);
// Themes end
var chart = am4core.create("chartdiv", am4charts.SlicedChart);
chart.paddingBottom = 30;
chart.data = [{
"name": "Stage #1",
"value": 600
}, {
"name": "Stage #2",
"value": 300
}, {
"name": "Stage #3",
"value": 200
}, {
"name": "Stage #4",
"value": 180
}, {
"name": "Stage #5",
"value": 50
}, {
"name": "Stage #6",
"value": 20
}, {
"name": "Stage #7",
"value": 280
}];
var series = chart.series.push(new am4charts.PyramidSeries());
series.dataFields.value = "value";
series.dataFields.category = "name";
series.alignLabels = true;
series.valueIs = "height";
JSON
// Themes begin
am4core.useTheme(am4themes_animated);
// Themes end
var chart = am4core.createFromConfig({
"paddingBottom": 30,
"data": [{
"name": "Stage #1",
"value": 600
}, {
"name": "Stage #2",
"value": 300
}, {
"name": "Stage #3",
"value": 200
}, {
"name": "Stage #4",
"value": 180
}, {
"name": "Stage #5",
"value": 50
}, {
"name": "Stage #6",
"value": 20
}, {
"name": "Stage #7",
"value": 280
}],
"series": [{
"type": "PyramidSeries",
"dataFields": {
"value": "value",
"category": "name"
},
"alignLabels": true,
"valueIs": "height"
}]
}, "chartdiv", "SlicedChart");
HTML
<div id="chartdiv"></div>
CSS
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
#chartdiv {
width: 100%;
height: 350px;
}
Resources
https://cdn.amcharts.com/lib/4/core.js
https://cdn.amcharts.com/lib/4/charts.js
https://cdn.amcharts.com/lib/4/themes/animated.js
All in one page
<!-- Resources -->
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<script src="https://cdn.amcharts.com/lib/4/charts.js"></script>
<script src="https://cdn.amcharts.com/lib/4/themes/animated.js"></script>
<!-- Chart code -->
<script>
// Themes begin
am4core.useTheme(am4themes_animated);
// Themes end
var chart = am4core.create("chartdiv", am4charts.SlicedChart);
chart.paddingBottom = 30;
chart.data = [{
"name": "Stage #1",
"value": 600
}, {
"name": "Stage #2",
"value": 300
}, {
"name": "Stage #3",
"value": 200
}, {
"name": "Stage #4",
"value": 180
}, {
"name": "Stage #5",
"value": 50
}, {
"name": "Stage #6",
"value": 20
}, {
"name": "Stage #7",
"value": 280
}];
var series = chart.series.push(new am4charts.PyramidSeries());
series.dataFields.value = "value";
series.dataFields.category = "name";
series.alignLabels = true;
series.valueIs = "height";
</script>
<!-- HTML -->
<div id="chartdiv"></div>