<!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 {
min-height: 530px;
width: 100%;
height: 100%;
}
.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 getCurrentDate = () => {
let date = new Date();
let midnight = new Date(
date.getFullYear(),
date.getMonth(),
date.getDate(),
0,
0,
0
);
let diff = date.getTime() - midnight.getTime();
return [
[(diff / 43200000) * 60],
[date.getMinutes()],
[date.getSeconds()]
];
};
let date = getCurrentDate();
let chartConfig = {
type: 'gauge',
backgroundColor: '#fff',
plot: {
tooltip: {
visible: false,
},
hoverState: {
visible: false,
},
shadow: false,
},
plotarea: {
margin: '15px 40px',
},
scaleR: {
values: '0:60:5',
aperture: 360,
center: {
backgroundColor: 'black',
borderColor: '#ccc',
borderWidth: '2px',
size: '10px',
},
item: {
bold: true,
fontSize: '12px',
offsetR: -45,
},
labels: [
'',
'I',
'II',
'III',
'IV',
'V',
'VI',
'VII',
'VIII',
'IX',
'X',
'XI',
'XII',
],
minorTick: {
lineColor: '#7d7d7d',
placement: 'inner',
size: '10px',
},
minorTicks: 4,
refAngle: 90,
ring: {
backgroundColor: 'white',
rules: [{
backgroundColor: '#ccc',
borderColor: '#444',
borderWidth: '2px',
rule: '%k >= 0',
}, ],
size: '10px',
},
tick: {
lineColor: '#000',
placement: 'inner',
size: '10px',
},
},
series: [{
values: date[0],
backgroundColor: '#000',
csize: '7px',
height: 0.5,
size: '95px',
},
{
values: date[1],
backgroundColor: '#000',
borderWidth: '1px',
csize: '9px',
size: 0.9,
},
{
values: date[2],
backgroundColor: 'red',
csize: '2px',
size: '1px',
},
],
};
/*
* Bind A function to the chart that updates
* the value every 5 milliseconds
*/
zingchart.bind('myChart', 'load', () => {
setInterval(() => {
zingchart.exec('myChart', 'setseriesvalues', {
values: getCurrentDate(),
});
}, 1000);
});
zingchart.render({
id: 'myChart',
data: chartConfig,
height: '100%',
width: '100%',
});
</script>
</body>
</html>
let getCurrentDate = () => {
let date = new Date();
let midnight = new Date(
date.getFullYear(),
date.getMonth(),
date.getDate(),
0,
0,
0
);
let diff = date.getTime() - midnight.getTime();
return [[(diff / 43200000) * 60], [date.getMinutes()], [date.getSeconds()]];
};
let date = getCurrentDate();
let chartConfig = {
type: 'gauge',
backgroundColor: '#fff',
plot: {
tooltip: {
visible: false,
},
hoverState: {
visible: false,
},
shadow: false,
},
plotarea: {
margin: '15px 40px',
},
scaleR: {
values: '0:60:5',
aperture: 360,
center: {
backgroundColor: 'black',
borderColor: '#ccc',
borderWidth: '2px',
size: '10px',
},
item: {
bold: true,
fontSize: '12px',
offsetR: -45,
},
labels: [
'',
'I',
'II',
'III',
'IV',
'V',
'VI',
'VII',
'VIII',
'IX',
'X',
'XI',
'XII',
],
minorTick: {
lineColor: '#7d7d7d',
placement: 'inner',
size: '10px',
},
minorTicks: 4,
refAngle: 90,
ring: {
backgroundColor: 'white',
rules: [
{
backgroundColor: '#ccc',
borderColor: '#444',
borderWidth: '2px',
rule: '%k >= 0',
},
],
size: '10px',
},
tick: {
lineColor: '#000',
placement: 'inner',
size: '10px',
},
},
series: [
{
values: date[0],
backgroundColor: '#000',
csize: '7px',
height: 0.5,
size: '95px',
},
{
values: date[1],
backgroundColor: '#000',
borderWidth: '1px',
csize: '9px',
size: 0.9,
},
{
values: date[2],
backgroundColor: 'red',
csize: '2px',
size: '1px',
},
],
};
/*
* Bind A function to the chart that updates
* the value every 5 milliseconds
*/
zingchart.bind('myChart', 'load', () => {
setInterval(() => {
zingchart.exec('myChart', 'setseriesvalues', {
values: getCurrentDate(),
});
}, 1000);
});
zingchart.render({
id: 'myChart',
data: chartConfig,
height: '100%',
width: '100%',
});