我正在尝试使用gRapahel库在我的网站项目中创建条形图。我需要使用这个库,因为标准的ajax控件在IE8中不起作用。我已将所有* .js文件添加到我的项目中,并且还将以下行添加到web.config文件中:
<codeSubDirectories>
<add directoryName="CSCode"/>
<add directoryName="JSCode"/>
</codeSubDirectories>
当我尝试编译项目时,我在App_SubCode_JSCode.qgb8opkc.6.js文件中遇到3个错误:
自定义属性中只允许使用基本类型
未知的自定义属性类或构造函数
尚未声明变量'系统'
当我双击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")]
你能帮我解决这个问题吗? 提前谢谢。
编辑1:
我添加了以下代码来创建图表,但我收到错误:
Microsoft JScript运行时错误:预期的对象
在线:
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 :(得分:0)
我找到了溶剂(我认为)。我将VSCode移到了App_Code文件夹之外,我可以编译该项目。