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() + "(万元)";
}
怎么图列老是显示最后一个贷款种类呢,麻烦大虾看看问题处在哪里 展开
1个回答
展开全部
在循环中修改:
//将这行注释打开
string ses = "Series" + (i + 1).ToString();
chrCount.Series[ses].LegendText = i;
看看是否有效果?
//将这行注释打开
string ses = "Series" + (i + 1).ToString();
chrCount.Series[ses].LegendText = i;
看看是否有效果?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询