2017-02-22 1 views
1

값이 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> 
+0

[볼록 toastr (https://foxandxss.github.io/angular-toastr/) –

답변

0

자바 스크립트 모달은 항상 페이지를 차단합니다. 거기에 libs와 - 당신은 모달

http://getbootstrap.com/javascript/

무엇인가라는 toastr (또는 으르렁 거리는 소리)를 사용하고 당신이 단순한 알림을하고 있다면 생각할 수있는 또 다른 방법은 부트 스트랩 자신의 팝업 코드를 구현하거나, 예를 들어 라이브러리를 사용할 필요가 이것을 위해서도. fussioncharts 업데이트

이 예를 살펴

http://www.fusioncharts.com/dev/using-with-javascript-libraries/jquery/updating-chart-properties-using-jquery.html#changing-the-data-for-an-existing-chart

+0

매 30 초에서 그래프를 새로 방법 . – Swapna

관련 문제