当前位置:编程学习 > C#/ASP.NET >>

求助:为何我做的MSCHART图表无法显示右边的线条说明?谢谢!

程序段如下:Series1.LegendText我有加啊,为什么显示不出呢?郁闷

Series Series3 = new Series("61-90天");
                Series3.Name = "61-90天";
                Series1.LegendText = "61-90天";
                Series3.ChartType = SeriesChartType.Line;               //图标集类型,Line为直线,SpLine为曲线  
                Series3.Color = Color.Blue;                              //线条颜色  
                Series3.BorderWidth = 2;                                  //线条宽度  
                Series3.ShadowOffset = 1;                                 //阴影宽度  
                Series3.IsVisibleInLegend = true;                         //是否显示数据说明  
                Series3.IsValueShownAsLabel = true;
                Series3.MarkerStyle = MarkerStyle.Diamond;               //线条上的数据点标志类型  
                Series3.MarkerSize = 8;

                for (int col = 0; col < dt.Rows.Count; col++)
                {
                    string xVal = dt.Rows[col][0].ToString();
                    double yVal = Convert.ToDouble(dt.Rows[col][5].ToString());

                    //Chart1.Series[seriesName].Points.AddXY(xVal, yVal);
                    Series3.Points.AddXY(xVal, yVal);
                }

                Chart1.Series.Add(Series3);


                //设置坐标轴
                Chart1.ChartAreas[0].AxisX.LineColor = Color.Blue;
                Chart1.ChartAreas[0].AxisY.LineColor = Color.Blue;
                Chart1.ChartAreas[0].AxisX.LineWidth = 2;
                Chart1.ChartAreas[0].AxisY.LineWidth = 2;
                Chart1.ChartAreas[0].AxisY.Title = "余额(万元)";
                Chart1.ChartAreas[0].AxisX.Title = "日期"; --------------------编程问答-------------------- 前台hmtl中要加<legend></legend>,我做的时候都是在前台给了series,<asp:series>可以在后台直接添加。。。。。。官网有例子,学习一下,比较简单好用的!!
补充:.NET技术 ,  图表区
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,