0

私は2つの異なる値を与える2つのクエリを持っています

1 つのクエリで空き領域が得られます

select sum(freesize) as freespace from freespace 

次のクエリは totalspace を返します

select sum(NumRegions) as totalspace from fileidtofilename 

次に、使用済みスペース = 合計スペース - 空きスペース

使用領域と空き領域を円グラフで表示したいのですが...

助言がありますか

円グラフは次のとおりです。

 <asp:Chart ID="Chart4" runat="server" >
    <Series>
        <asp:Series ChartType="Pie" Name="Series1">
        </asp:Series>
    </Series>
    <ChartAreas>
        <asp:ChartArea Name="ChartArea1">
        </asp:ChartArea>
    </ChartAreas>
</asp:Chart>
4

1 に答える 1

0

これがあなたのやり方です:

まず、SQlクエリを使用して空き領域と使用済み領域を取得しました

それから私はこれをしました...これがsome1に役立つことを願っています

protected void Page_Load(object sender, EventArgs e)
    {


        GetFreeSpace();
        GetTotalData();
        usedSpace = totalSpace - freeSpace;

        // Display 3D Pie Chart

        Chart1.Series[0].ChartType = SeriesChartType.Pie;

        Chart1.Series[0]["PieLabelStyle"] = "Inside";

        Chart1.ChartAreas[0].Area3DStyle.Enable3D = true;



        // Display a Title

        Chart1.Titles.Add("Show Space");



        // Add Data to Display

        string[] xValues = { "Used Space","Free Space" };

        double[] yValues = { usedSpace,freeSpace};

        Chart1.Series[0].Points.DataBindXY(xValues, yValues);



        // Call Out The Letter "Free Space"

        Chart1.Series[0].Points[1]["Exploded"] = "true";



        // Display a Legend

        Chart1.Legends.Add(new Legend("Alphabet"));

        Chart1.Legends["Alphabet"].Title = "Letters";

        Chart1.Series[0].Legend = "Alphabet";


    }
于 2009-12-28T22:06:13.947 に答える