Chart.js未在Visual Studio中显示。它没有执行

时间:2016-10-19 07:35:51

标签: javascript visual-studio-2010

Chart.js未在visual studio中显示。它没有跑,不知道为什么。 我已经用崇高,记事本检查过,它工作正常。但是在Visual Studio asp.net平台上,它无法正常工作。

<!DOCTYPE HTML>
<html>
<head>
<script src="http://canvasjs.com/assets/script/canvasjs.min.js"></script>
<script type="text/javascript">

window.onload = function () {
    var chart = new CanvasJS.Chart("chartContainer", {
        theme: "theme2",//theme1
        title:{
            text: "Basic Column Chart - CanvasJS"              
        },
        animationEnabled: false,   // change to true
        data: [              
        {
            // Change type to "bar", "area", "spline", "pie",etc.
            type: "column",
            dataPoints: [
                { label: "apple",  y: 10  },
                { label: "orange", y: 15  },
                { label: "banana", y: 25  },
                { label: "mango",  y: 30  },
                { label: "grape",  y: 28  }
            ]
        }
        ]
    });
    chart.render();
}
</script>
</head>
<body>
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

请参阅Tutorials on adding Charts into ASP.NET MVC Applications以在ASP .Net应用程序中集成CanvasJS图表。