我有两个查询,它们给出了两个不同的值
一个查询给出了空闲空间
select sum(freesize) as freespace from freespace 下一个查询给出totalspace
select sum(NumRegions) as totalspace from fileidtofilename 然后usedspace= totalspace- freespace
现在我想在拼图中显示已用空间区域和空闲空间区域...
有什么建议吗
片段图是:
<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>发布于 2009-12-29 06:06:14
下面是你如何做到这一点:
首先,我使用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";
}https://stackoverflow.com/questions/1959700
复制相似问题