2016-02-17 52 views
0

我正在創建一個從Mango Automation獲取數據並將其顯示在圖表中的網頁。出於某種原因,在頁面加載後會自動出現div。 div是不需要的,我不希望它對觀衆可見,所以我應該如何去除它?如何擺脫頁面加載後出現的div

這裏的情況

enter image description here

下面的圖像的源代碼,我的網頁

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8" /> 
    <title>NitraattiTyppi</title> 
    <style> 
    #data{ 
    width:60%; 
    margin: 0 auto; 
    } 

    #Graafi { 
    height: 600px; 
    background-color: #FFFFFF; 
    border: 2px outset black; 
    padding: 50px; 
    background-color: rgba(255,255,255, 0.8); 
    } 
    </style> 
    <!-- Add the Mango Favicon --> 
    <link rel="icon" href="/images/favicon.ico"> 

    <!-- Page Style --> 



    <!-- Base Library --> 
    <script type="text/javascript" src="/resources/loaderConfig.js"></script> 
    <script type="text/javascript" src="/resources/require.js"></script> 
    <script type="text/javascript" src="/resources/main.js"></script> 
    <script type="text/javascript" src="http://www.amcharts.com/lib/3/amcharts.js"></script> 
    <script type="text/javascript" src="http://www.amcharts.com/lib/3/serial.js"></script> 
    <script type="text/javascript" src="http://www.amcharts.com/lib/3/themes/light.js"></script> 
    <script type="text/javascript" src="http://www.amcharts.com/lib/3/plugins/export/export.js"></script> 

    <script type="text/javascript"> 

    require(['jquery', 'mango/api', 'mango/TimePresetPicker', 'mango/SerialChart', 
      'mango/PointValueDataProvider', 'mango/ProviderOptionsManager', 'jquery.notify'], 

    function($, MangoAPI, TimePresetPicker, SerialChart, PointValueDataProvider, 
      ProviderOptionsManager, point, exportXLSX) { 
      //Setting up the chart 
     chart = new SerialChart({ 
      divId: 'Graafi', 
      amChart: { 
       theme: "light", 
       chartScrollbar: { 
        enabled: true, 
        graph: 'DP_211607', 
        offset: 30, 
        oppositeAxis: false, 
        scrollbarHeight: 90 
       }, 
       legend: { 
        align: 'center', 
       }, 
       categoryAxis: { 
        minPeriod: 'ss' 
       } 
      } 
     }); 

     //Creating the display on the page 
     chart.createDisplay(); 

        // create a point value data provider 
     var dataProvider = new PointValueDataProvider(null, { 
      // convert point values to their specified unit 
      apiOptions: { converted: true } 
     }); 

        // setup the time picker with its inputs 
     var timePicker = new TimePresetPicker({ 
      presetPicker: $('#presetPicker'), 
      defaultPeriod: 'WEEK_TO_DATE' 
     }, 
     TimePresetPicker.presetValues = [ 
      { 
       id: "DAY_TO_DATE", 
       value: 70, 
       name: "Day" 
      }, 
      { 
       id: "WEEK_TO_DATE", 
       value: 75, 
       name: "Week" 
      }, 
      { 
       id: "MONTH_TO_DATE", 
       value: 80, 
       name: "Month" 
      }, 
      { 
       id: "YEAR_TO_DATE", 
       value: 85, 
       name: "Year" 
      }, 
      { 
       id: "INCEPTION_TO_NOW", 
       value: 105, 
       name: "Whole history" 
      } 
     ]); 
     var providerManager = new ProviderOptionsManager({ 
      errorFunction: MangoAPI.logError, 
      timePicker: timePicker 
     }); 

     // link the chart to the data provider 
     dataProvider.addListener(chart); 

     // link the provider to the provider manager 
     providerManager.addProvider(dataProvider); 

     $('#presetPicker').on('change', function() { 
      // update the data provider 
      providerManager.refreshProviders(); 
     }); 
     function loadPoints() { 
      MangoAPI.defaultApi.queryPoints('xid=DP_211607').then(function(results){ 
        dataProvider.addDataPoint(results.items[0]); 
      }).fail(MangoAPI.logError); 
     }; 
     loadPoints(); 
     this.onload = function(){ 
      providerManager.refreshProviders(); 
     }; 
    }); 

</script> 
</head> 
<body> 
    <div id="data"> 
     <header></header> 
     <div id="Graafi"></div> 
     <div class="input"> 
      <select id="presetPicker" class="form-control"></select> 
     </div> 
     <input type="button" value="Download" onclick="exportXLSX();" /> 
     <footer></footer> 
    </div> 
</body> 
</html> 
+0

'的document.getElementById( 'confirmDialog')的style.display = '無';' – baao

+0

這個工作也是如此。萬分感謝! – Nyoa

回答

0

使用CSS,只是將其隱藏!

#confirmDialog { display: none; } 
+0

這工作,謝謝。我以前曾試圖這樣做,但似乎我當時做了一些錯誤,但沒有奏效 – Nyoa

+0

太棒了!我很高興它幫助:) –

相關問題