如何从asp.net中删除MS图表中的图例

时间:2015-05-11 17:44:15

标签: asp.net google-visualization google-chartwrapper

我正在尝试删除或禁用MS图表中的图例,但我似乎无法找到删除图例的位置和方法

<script type="text/javascript">
        google.load("visualization", "1", { packages: ["corechart"] });
        google.setOnLoadCallback(drawChart);
        function drawChart() {
            var options = {
                title: 'Total Hours By Project Category',
                is3D: true

            };
            $.ajax({
                type: "POST",
                url: "Home.aspx/GetChartData",
                data: '{}',
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (r) {
                    var data = google.visualization.arrayToDataTable(r.d);
                    var chart = new google.visualization.PieChart($("#chart")[0]);
                    chart.draw(data, options);
                },
                failure: function (r) {
                    alert(r.d);
                },
                error: function (r) {
                    alert(r.d);
                }
            });
        }
    </script>

在aspx中

   <div id="chart" style="width: 500px; height: 500px; "> </div>

1 个答案:

答案 0 :(得分:2)