在C#中用chart为什么图例会变成这样,右边的为正常的
stringdbPath=@"D:\历年高考分数.db";stringsq=@"DataSource="+dbPath;m=newSQLiteConnection(sq)...
string dbPath = @"D:\历年高考分数.db"; string sq = @"Data Source=" + dbPath; m = new SQLiteConnection(sq); m.Open(); SQLiteDataAdapter mAdapter = new SQLiteDataAdapter("select Volume1,Volume2 from 饼形图2", m); DataSet ds = new DataSet(); mAdapter.Fill(ds); DataTable dt = ds.Tables[0]; //设置图表的数据 Chart1.DataSource = dt; Chart1.Series[0].ChartType = SeriesChartType.Pie; Chart1.Series[0].XValueMember = "Volume1";//图例数据成员列 Chart1.Series[0].YValueMembers = "Volume2";//饼形图上数据成员列 Chart1.Series[0].IsValueShownAsLabel = true;// Chart1.Series[0].IsXValueIndexed = false; Chart1.Series[0].Label = "#PERCENT"; Chart1.Series[0].LegendText = "#INDEX:#VALX"; Chart1.Series[0].ToolTip = "#VALX"; Chart1.DataBind(); m.Close();
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询