<!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 {
width: 100%;
height: 100%;
min-height: 530px;
}
.zc-ref {
display: none;
}
</style>
</head>
<body>
<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"];
let chartConfig = {
type: 'gauge',
theme: 'classic',
backgroundColor: 'black',
scaleR: {
values: '0:100:20',
aperture: 270,
backgroundColor: 'black',
center: {
backgroundColor: '#CC0000',
size: '11px',
},
guide: {
alpha: 1,
backgroundColor: 'black', // Set the interior color of the gauge so that it is solid black, not alternating colors
},
item: {
color: 'white', // Set the color and font of the labels
offsetR: -55, // Move the labels to the inside
placement: 'inner',
},
lineColor: 'none',
minorTick: {
lineColor: 'white',
placement: 'inner',
size: '7px',
visible: true,
},
minorTicks: 4,
ring: {
type: 'circle',
rules: [{
backgroundColor: 'red',
borderWidth: '0px',
rule: '%v<80',
},
{
backgroundColor: 'limeGreen',
borderWidth: '0px',
rule: '%v>=80',
},
],
size: '8px',
},
tick: {
lineColor: 'white',
lineWidth: '3px',
size: '14px',
},
},
labels: [{
text: '85.67%',
color: 'white',
width: '6%',
x: '47%',
y: '76%',
}, ],
shapes: [{
type: 'pie', // Add a second ring to the outside
backgroundColor: 'white limeGreen',
size: '190px',
slice: 175,
x: '50%',
y: '54.0%',
zIndex: 0,
}, ],
series: [{
values: [85.67],
backgroundColor: 'limeGreen',
csize: '10px', // Set the width of the needle
shadow: false,
size: '70px', // Set the length of the needle
}, ],
};
zingchart.render({
id: 'myChart',
data: chartConfig,
height: '100%',
width: '100%',
});
</script>
</body>
</html>
let chartConfig = {
type: 'gauge',
theme: 'classic',
backgroundColor: 'black',
scaleR: {
values: '0:100:20',
aperture: 270,
backgroundColor: 'black',
center: {
backgroundColor: '#CC0000',
size: '11px',
},
guide: {
alpha: 1,
backgroundColor: 'black', // Set the interior color of the gauge so that it is solid black, not alternating colors
},
item: {
color: 'white', // Set the color and font of the labels
offsetR: -55, // Move the labels to the inside
placement: 'inner',
},
lineColor: 'none',
minorTick: {
lineColor: 'white',
placement: 'inner',
size: '7px',
visible: true,
},
minorTicks: 4,
ring: {
type: 'circle',
rules: [
{
backgroundColor: 'red',
borderWidth: '0px',
rule: '%v<80',
},
{
backgroundColor: 'limeGreen',
borderWidth: '0px',
rule: '%v>=80',
},
],
size: '8px',
},
tick: {
lineColor: 'white',
lineWidth: '3px',
size: '14px',
},
},
labels: [
{
text: '85.67%',
color: 'white',
width: '6%',
x: '47%',
y: '76%',
},
],
shapes: [
{
type: 'pie', // Add a second ring to the outside
backgroundColor: 'white limeGreen',
size: '190px',
slice: 175,
x: '50%',
y: '54.0%',
zIndex: 0,
},
],
series: [
{
values: [85.67],
backgroundColor: 'limeGreen',
csize: '10px', // Set the width of the needle
shadow: false,
size: '70px', // Set the length of the needle
},
],
};
zingchart.render({
id: 'myChart',
data: chartConfig,
height: '100%',
width: '100%',
});