값이 3보다 작 으면 팝업을 표시하려고합니다. 경고 기능을 사용했지만이 경고 이벤트가 발생하면 페이지가 렌더링되지 않습니다. 표시 할 페이지를 차단하지 않고 팝업을 표시하는 방법 및 30 초마다 차트를 새로 고치는 방법렌더링 할 페이지를 차단하지 않고 팝업 알림 메시지를 표시하는 방법 및 30 초마다 차트를 새로 고치는 방법
<script>
FusionCharts.ready(function() {
LoadChart();
});
function LoadChart() {
$.ajax({
url: '@Url.Action("get", "air")',//remote api address
type: 'GET',
crossDomain: true,
success: function (data) {
if (data.success) {
var dust= data.sensorsdata.cl;
if (dust > 3)
alert("dust is high");
$("#lblDate").text(data.sensorsdata.CurrentTime);
$("#currenttime").show();
var dustchart= new FusionCharts({
type: 'angulargauge',
renderAt: 'ph-container',
width: '450',
height: '300',
dataFormat: 'json',
dataSource: {
"chart": {
"caption": "Chlorine ",
"lowerLimit": "0",
"upperLimit": "14",
"showValue": "1",
"valueBelowPivot": "1",
"theme": "fint"
},
"colorRange": {
"color": [{
"minValue": "0",
"maxValue": "5",
"code": "#6baa01"
}, {
"minValue": "5",
"maxValue": "10",
"code": "#f8bd19"
}, {
"minValue": "10",
"maxValue": "14",
"code": "#e44a00"
}]
},
"dials": {
"dial": [{
"value": dust
}]
}
}
});
dustchart.render();
}
}
});
}
</script>
<td><div id="dust-container" style="float:left;"></div></td>
[볼록 toastr (https://foxandxss.github.io/angular-toastr/) –