mschart饼图绑定数据源问题 30
DataTabledt=CStatsReport.StatsGDZXMRSJQD_TXH(dtDateStart,dtDateEnd,szJBH,refobjDB);ch...
DataTable dt = CStatsReport.StatsGDZXMRSJQD_TXH(dtDateStart, dtDateEnd, szJBH, ref objDB);
chrCount.DataSource = dt;
//Series series = new Series("series4");
//series.ChartType = SeriesChartType.Pie;
//series.Legend = "Legend1";
chrCount.ChartAreas[0].Area3DStyle.Enable3D = true;
chrCount.Series["Series1"].IsValueShownAsLabel = true;
chrCount.Series["Series1"].CustomProperties = "DoughnutRadius=25, PieDrawingStyle=Concave, CollectedLabel=Other, MinimumRelativePieSize=20";
chrCount.Series["Series1"].Label = "#PERCENT{P1}";
chrCount.Series["Series1"].BackGradientStyle = GradientStyle.None;
for (int i = 0; i < dt.Rows.Count; i++)
{
chrCount.Series["Series1"].Points.AddXY(dt.Rows[i]["szDKZL"], dt.Rows[i]["dDKJE"].ToString());
chrCount.Series["Series1"].ToolTip = dt.Rows[i]["dDKJE"].ToString();
//string ses = "Series" + (i + 1).ToString();
chrCount.Series["Series1"].LegendText = dt.Rows[i]["szDKZL"].ToString() + ":" + dt.Rows[i]["nCount"].ToString() + "笔" + dt.Rows[i]["dDKJE"].ToString() + "(万元)";
}
怎么图列老是显示最后一个贷款种类呢,麻烦大虾看看问题处在哪里 展开
chrCount.DataSource = dt;
//Series series = new Series("series4");
//series.ChartType = SeriesChartType.Pie;
//series.Legend = "Legend1";
chrCount.ChartAreas[0].Area3DStyle.Enable3D = true;
chrCount.Series["Series1"].IsValueShownAsLabel = true;
chrCount.Series["Series1"].CustomProperties = "DoughnutRadius=25, PieDrawingStyle=Concave, CollectedLabel=Other, MinimumRelativePieSize=20";
chrCount.Series["Series1"].Label = "#PERCENT{P1}";
chrCount.Series["Series1"].BackGradientStyle = GradientStyle.None;
for (int i = 0; i < dt.Rows.Count; i++)
{
chrCount.Series["Series1"].Points.AddXY(dt.Rows[i]["szDKZL"], dt.Rows[i]["dDKJE"].ToString());
chrCount.Series["Series1"].ToolTip = dt.Rows[i]["dDKJE"].ToString();
//string ses = "Series" + (i + 1).ToString();
chrCount.Series["Series1"].LegendText = dt.Rows[i]["szDKZL"].ToString() + ":" + dt.Rows[i]["nCount"].ToString() + "笔" + dt.Rows[i]["dDKJE"].ToString() + "(万元)";
}
怎么图列老是显示最后一个贷款种类呢,麻烦大虾看看问题处在哪里 展开
展开全部
在循环中修改:
//将这行注释打开
string ses = "Series" + (i + 1).ToString();
chrCount.Series[ses].LegendText = i;
看看是否有效果?
//将这行注释打开
string ses = "Series" + (i + 1).ToString();
chrCount.Series[ses].LegendText = i;
看看是否有效果?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
网易云信
2023-12-06 广告
2023-12-06 广告
UIkit是一套轻量级、模块化且易于使用的开源UI组件库,由YOOtheme团队开发。它提供了丰富的界面元素,包括按钮、表单、表格、对话框、滑块、下拉菜单、选项卡等等,适用于各种类型的网站和应用程序。UIkit还支持响应式设计,可以根据不同...
点击进入详情页
本回答由网易云信提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询