2013-06-25 46 views
0

我想使用gRapahel庫在我的網站項目中創建條形圖。我需要使用這個庫,因爲標準的ajax控件在IE8中不起作用。我添加了所有* .js文件到我的項目,我還添加了以下行web.config文件:gRaphael庫編譯錯誤

<codeSubDirectories> 
    <add directoryName="CSCode"/> 
    <add directoryName="JSCode"/> 
    </codeSubDirectories> 

當我試圖編譯我的項目,我在App_SubCode_JSCode.qgb8opkc.6.js文件有3個錯誤:

Only primitive types are allowed in a custom attribute

Unknown custom attribute class or constructor

Variable 'System' has not been declared

當我雙擊了eroors重定向我的文件,它包含以下線誤差修改:

//------------------------------------------------------------------------------ 
/// <autogenerated> 
///  This code was generated by a tool. 
///  Runtime Version: 4.0.30319.269 
/// 
///  Changes to this file may cause incorrect behavior and will be lost if 
///  the code is regenerated. 
/// </autogenerated> 
//------------------------------------------------------------------------------ 

[assembly: System.CodeDom.Compiler.GeneratedCodeAttribute("ASP.NET", "4.0.30319.272")] 
[assembly: System.Security.SecurityRulesAttribute(System.Security.SecurityRuleSet.Level2)] 
[assembly: System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.0")] 

你能plase幫我解決這個問題? 在此先感謝。

EDIT 1:

我在下面的代碼添加到創建圖表,但我得到錯誤:

Microsoft JScript runtime error: Object expected

上一行:

var r = Raphael("InputHours"), 
<script type="text/javascript"> 
     window.onload = function() { 
      var r = Raphael("InputHours"), 
        fin = function() { 
         this.flag = r.popup(this.bar.x, this.bar.y, this.bar.value || "0").insertBefore(this); 
        }, 
        fout = function() { 
         this.flag.animate({ opacity: 0 }, 300, function() { this.remove(); }); 
        }, 
        fin2 = function() { 
         var y = [], res = []; 
         for (var i = this.bars.length; i--;) { 
          y.push(this.bars[i].y); 
          res.push(this.bars[i].value || "0"); 
         } 
         this.flag = r.popup(this.bars[0].x, Math.min.apply(Math, y), res.join(", ")).insertBefore(this); 
        }, 
        fout2 = function() { 
         this.flag.animate({ opacity: 0 }, 300, function() { this.remove(); }); 
        }, 
        txtattr = { font: "12px sans-serif" }; 

      r.text(160, 10, "Single Series Chart").attr(txtattr); 
      r.text(480, 10, "Multiline Series Stacked Chart").attr(txtattr); 
      r.text(160, 250, "Multiple Series Chart").attr(txtattr); 
      r.text(480, 250, "Multiline Series Stacked Chart\nColumn Hover").attr(txtattr); 

      r.barchart(10, 10, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10]]).hover(fin, fout); 
      r.hbarchart(330, 10, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10], [10, 2, 1, 5, 32, 13, 20, 55]], { stacked: true }).hover(fin, fout); 
      r.hbarchart(10, 250, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10], [10, 2, 1, 5, 32, 13, 20, 55]]).hover(fin, fout); 
      var c = r.barchart(330, 250, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10], [10, 2, 1, 5, 32, 13, 20, 55]], { stacked: true, type: "soft" }).hoverColumn(fin2, fout2); 
     }; 



    </script> 

回答

0

我發現sollution爲(我認爲)。我將CSCode移出了App_Code文件夾,我可以編譯該項目。