2014-01-30 71 views
1

我正嘗試使用jchartfx創建圖表。我可以嘗試使用提供的示例。我的問題是當我直接從文件夾運行HTML。它的工作和渲染正常。但是當我將該頁面添加到Visual Studio並嘗試運行該應用程序。我得到運行時Js錯誤。在Visual Studio環境中發生錯誤

,這裏是我的HTML代碼

<!DOCTYPE html> 
<html> 
<head> 
    <link href="jchartfx.css" rel="stylesheet" /> 
    <script src="jchartfx.system.js"></script> 
    <script src="jchartfx.coreBasic.js"></script> 
</head> 
<body onload="loadChart()"> 

    <div id="ChartDiv" style="width: 600px; height: 400px"></div> 

    <script type="text/javascript" lang="javascript"> 

     var chart1; 

     function loadChart() { 

      chart1 = new cfx.Chart(); 
      chart1.getData().setSeries(2); 
      chart1.getAxisY().setMin(500); 
      chart1.getAxisY().setMax(2000); 

      var series1 = chart1.getSeries().getItem(0); 
      var series2 = chart1.getSeries().getItem(1); 

      series1.setGallery(cfx.Gallery.Lines); 
      series2.setGallery(cfx.Gallery.Bar); 

      var data = [ 
      { "Month": "Jan", "Bikes": 1800, "Parts": 1300 }, 
      { "Month": "Feb", "Bikes": 1760, "Parts": 900 }, 
      { "Month": "Mar", "Bikes": 1740, "Parts": 970 }, 
      { "Month": "Apr", "Bikes": 1750, "Parts": 1010 }, 
      { "Month": "May", "Bikes": 1810, "Parts": 1070 }, 
      { "Month": "Jun", "Bikes": 1920, "Parts": 1180 } 
      ]; 

      chart1.setDataSource(data); 

      var divHolder = document.getElementById('ChartDiv'); 
      chart1.create(divHolder); 
     } 
    </script> 
</body> 
</html> 

Here is my tutorial link

錯誤:無法獲得屬性「叫」值:對象爲空或未定義

爲什麼我得到這個任何建議?

更新:當我嘗試運行MVC應用程序視圖

我在頭部分,它正在fine.but它添加<meta content="IE=9" http-equiv="X-UA-Compatible" />給出了同樣的錯誤。

是否有任何元標記會解決這個問題?

回答

0

嘗試添加<meta http-equiv="X-UA-Compatible" content="IE=8" />標記。

+0

我試過了代碼,但沒有運氣。仍然得到相同的錯誤。 – codebot

相關問題