与ASP.NET饼图? [英] Pie chart with ASP.NET?

查看:120
本文介绍了与ASP.NET饼图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用ASP.NET和C#。所有饼图控件,我看到的将只允许每个类别将被分配一个值。

I am using ASP.NET and C#. All of the pie chart controls that I see will only allow each category to be assigned one value.

但我想要做的是显示哪些每个产品显示多个值的饼图。

But what I want to do is show a pie chart which displays multiple values per product.

是否有这样的饼图在ASP.NET?

Is there any solution for this kind of pie chart in ASP.NET?

推荐答案

是的,你可以使用使用由 < STRONG>谷歌图表

Yes,you can use use that by Google Charts

谷歌图表工具功能强大,简单易用,而且免费。试试我们
  丰富的画廊交互式图表和数据的工具。

Google chart tools are powerful, simple to use, and free. Try out our rich gallery of interactive charts and data tools.

谷歌图表提供了可视化的数据上一个完美的方式你
  网站。从简单的折线图到复杂的分层树图,
  图表库提供了大量准备使用的图表类型的。

Google Charts provides a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart gallery provides a large number of ready-to-use chart types.

使用谷歌图表最常用的方法是使用简单的JavaScript
  您在您的网页中嵌入。您加载一些谷歌图库,
  列出数据进行绘制,选择选项自定义图表,
  并最终创建一个图表对象,你选择一个ID。然后,
  在后面的网页,创建一个具有该ID显示
  谷歌图。

The most common way to use Google Charts is with simple JavaScript that you embed in your web page. You load some Google Chart libraries, list the data to be charted, select options to customize your chart, and finally create a chart object with an id that you choose. Then, later in the web page, you create a with that id to display the Google Chart.

示例

<html>
  <head>
    <!--Load the AJAX API-->
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">

      // Load the Visualization API and the piechart package.
      google.load('visualization', '1.0', {'packages':['corechart']});

      // Set a callback to run when the Google Visualization API is loaded.
      google.setOnLoadCallback(drawChart);

      // Callback that creates and populates a data table,
      // instantiates the pie chart, passes in the data and
      // draws it.
      function drawChart() {

        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Topping');
        data.addColumn('number', 'Slices');
        data.addRows([
          ['Mushrooms', 3],
          ['Onions', 1],
          ['Olives', 1],
          ['Zucchini', 1],
          ['Pepperoni', 2]
        ]);

        // Set chart options
        var options = {'title':'How Much Pizza I Ate Last Night',
                       'width':400,
                       'height':300};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>

  <body>
    <!--Div that will hold the pie chart-->
    <div id="chart_div"></div>
  </body>
</html>

preVIEW:

Preview:

这篇关于与ASP.NET饼图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆