tags:

views:

47

answers:

0

I am trying to display a Dojo pie chart in .ascx control.

I am using this code to display

<script type="text/javascript">
    dojo.require("dojox.charting.Chart2D");
    var chart1;
    dojo.addOnLoad(function() {
        chart1 = new dojox.charting.Chart2D("simplechart");
        chart1.addPlot("default", {
            type: "Pie",
            fontColor: "white",
            labelOffset: 40,
            radius: 100
        });
        chart1.addSeries("Series 1", [
        { y: 1, color: "red" },
        { y: 2, color: "green" },
        { y: 1, color: "blue" },
        { y: 1, color: "orange" }
]);
        chart1.render();
    });
</script>

I can display in an .aspx page using this code.. but I am not able to display in .ascx why its happening like this?