求助:关于axMSChart实现饼状图的问题!!!

joe83 2007-04-22 01:34:21
Object[] myay=new Object[4];
for(int i=0;i<=3;i++)
{
String[] names = new string[4]{"类型1","类型2","类型3","类型4"};
Int32 count=0;
DataBase dbLink = new DataBase();
string strSQL = "SELECT COUNT(*) FROM 登记表 WHERE 类型='"+names[i].ToString()+"'";
try
{
count = dbLink.getCount( strSQL );
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
myay[i]=(Object)count.ToString();

}

axMSChart1.ChartData = myay;

axMSChart1.Legend.Location.LocationType = MSChart20Lib.VtChLocationType.VtChLocationTypeRight;
axMSChart1.Legend.Location.Visible = true;
}


这样的话可以显示一个饼状图,但旁边的标注为:*:c1
*: c2
*: c3
*: c4
请问怎样把c1,c2,c3,c4替换为“类型1,类型2,类型3,类型4”。
刚刚接触C#,最好解答的详细些。

还有就是怎样把比例加进去。
多谢啦!!!!!
...全文
222 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

4,820

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧