<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ZingSoft Demo</title>
<script nonce="undefined" src="https://cdn.zingchart.com/zingchart.min.js"></script>
<style>
.chart--container {
height: 100%;
width: 100%;
min-height: 530px;
}
.zc-ref {
display: none;
}
</style>
</head>
<body>
<!-- CHART CONTAINER -->
<div id="myChart" class="chart--container">
<a class="zc-ref" href="https://www.zingchart.com/">Powered by ZingChart</a>
</div>
<script>
ZC.LICENSE = ["569d52cefae586f634c54f86dc99e6a9", "b55b025e438fa8a98e32482b5f768ff5"]; // window:load event for Javascript to run after HTML
// because this Javascript is injected into the document head
window.addEventListener('load', () => {
// Javascript code to execute after DOM content
// full ZingChart schema can be found here:
// https://www.zingchart.com/docs/api/json-configuration/
let chartConfig = {
graphset: [{
background: 'white',
labels: [{
text: 'FEMALES',
color: '#2C2C2C',
fontFamily: 'Helvetica',
fontSize: '14px',
fontWeight: '500',
x: '40%',
y: '120px'
},
{
text: 'MALES',
color: '#2C2C2C',
fontFamily: 'Helvetica',
fontSize: '14px',
fontWeight: '500',
x: '53%',
y: '120px'
}
]
},
{
type: 'pop-pyramid',
height: '90%',
y: '5%',
globals: {
fontSize: '14px'
},
title: {
text: "<span style=font-size:32px;>Pyramid Chart</span>\n<span style=color:'#6F6F6F'>European Union (27 countries) population by age group in 2021\nSource: EuroStat</span>",
fontWeight: 400,
htmlMode: true,
fontSize: '16px',
lineHeight: '24px',
textAlign: 'left'
},
legend: {
visible: false
},
options: {
labelPlacement: 'middle',
side2: {}
},
plot: {
tooltip: {
padding: '10px 15px',
borderRadius: '3px',
thousandsSeparator: ','
},
// animation docs here:
// https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
animation: {
effect: 'ANIMATION_EXPAND_BOTTOM',
method: 'ANIMATION_STRONG_EASE_OUT',
sequence: 'ANIMATION_BY_NODE',
speed: 222
}
},
plotarea: {
marginTop: 120,
},
scaleX: {
itemsOverlap: true,
maxItems: 99,
labels: ['< 5', '5-9', '10-14', '15-19', '20-24', '25-29', '30-34', '35-39', '40-44', '45-49', '50-54', '55-59', '60-64', '65-69', '70-74', '75-79', '80-84', '85+'],
},
scaleY: {
short: true,
},
series: [{
text: 'Male',
values: [10885103, 11520215, 12154270, 11900700, 12455020, 13177522, 14378825, 14791529, 15499193, 15841010, 16196778, 15548411, 14080591, 12276543, 10579209, 7320120, 5613071, 4316162],
backgroundColor: '#8BA9CC',
dataSide: 2
},
{
text: 'Female',
values: [10345114, 10921218, 11517315, 11211931, 11666432, 12613317, 14006845, 14622181, 15400994, 15808558, 16316445, 16026937, 15136983, 13925743, 12600909, 9482270, 8320358, 8749667],
backgroundColor: '#CDE6FD',
dataSide: 1
}
],
}
]
};
// render chart
zingchart.render({
id: 'myChart',
data: chartConfig,
output: "svg",
});
});
</script>
</body>
</html>
// window:load event for Javascript to run after HTML
// because this Javascript is injected into the document head
window.addEventListener('load', () => {
// Javascript code to execute after DOM content
// full ZingChart schema can be found here:
// https://www.zingchart.com/docs/api/json-configuration/
let chartConfig = {
graphset: [{
background: 'white',
labels: [{
text: 'FEMALES',
color: '#2C2C2C',
fontFamily: 'Helvetica',
fontSize: '14px',
fontWeight: '500',
x: '40%',
y: '120px'
},
{
text: 'MALES',
color: '#2C2C2C',
fontFamily: 'Helvetica',
fontSize: '14px',
fontWeight: '500',
x: '53%',
y: '120px'
}
]
},
{
type: 'pop-pyramid',
height: '90%',
y: '5%',
globals: {
fontSize: '14px'
},
title: {
text: "<span style=font-size:32px;>Pyramid Chart</span>\n<span style=color:'#6F6F6F'>European Union (27 countries) population by age group in 2021\nSource: EuroStat</span>",
fontWeight: 400,
htmlMode: true,
fontSize: '16px',
lineHeight: '24px',
textAlign: 'left'
},
legend: {
visible: false
},
options: {
labelPlacement: 'middle',
side2: {}
},
plot: {
tooltip: {
padding: '10px 15px',
borderRadius: '3px',
thousandsSeparator: ','
},
// animation docs here:
// https://www.zingchart.com/docs/tutorials/design-and-styling/chart-animation/#animation__effect
animation: {
effect: 'ANIMATION_EXPAND_BOTTOM',
method: 'ANIMATION_STRONG_EASE_OUT',
sequence: 'ANIMATION_BY_NODE',
speed: 222
}
},
plotarea: {
marginTop: 120,
},
scaleX: {
itemsOverlap: true,
maxItems: 99,
labels: ['< 5', '5-9', '10-14', '15-19', '20-24', '25-29', '30-34', '35-39', '40-44', '45-49', '50-54', '55-59', '60-64', '65-69', '70-74', '75-79', '80-84', '85+'],
},
scaleY: {
short: true,
},
series: [{
text: 'Male',
values: [10885103, 11520215, 12154270, 11900700, 12455020, 13177522, 14378825, 14791529, 15499193, 15841010, 16196778, 15548411, 14080591, 12276543, 10579209, 7320120, 5613071, 4316162],
backgroundColor: '#8BA9CC',
dataSide: 2
},
{
text: 'Female',
values: [10345114, 10921218, 11517315, 11211931, 11666432, 12613317, 14006845, 14622181, 15400994, 15808558, 16316445, 16026937, 15136983, 13925743, 12600909, 9482270, 8320358, 8749667],
backgroundColor: '#CDE6FD',
dataSide: 1
}
],
}
]
};
// render chart
zingchart.render({
id: 'myChart',
data: chartConfig,
output: "svg",
});
});