社区
图表区
帖子详情
chart 的一点小问题
祥子爱游戏
2013-12-20 09:50:38
LegendCollection”中已存在名为
“lengend1”的图表元素
...全文
305
7
打赏
收藏
chart 的一点小问题
LegendCollection”中已存在名为“lengend1”的图表元素
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
祥子爱游戏
2013-12-20
打赏
举报
回复
看foreach,数据是gridview中的数据,我改变了gridview中的数据就坏了
祥子爱游戏
2013-12-20
打赏
举报
回复
public void getchart() { //Chart1.ChartAreas.Clear();//清空 //string name = null; Chart1.Width = 1000; Chart1.Height = 400; Chart1.ChartAreas[0].AxisY.Minimum = 0; Chart1.ChartAreas[0].AxisY.Maximum = 0.3; Chart1.ChartAreas[0].AxisY.Interval = 0.02; //Chart1.ChartAreas[0].AxisX.Interval = 0.3; //Chart1.RenderType = RenderType.ImageTag; Chart1.ChartAreas[0].AxisY.Title = "百分率"; Chart1.ChartAreas[0].AxisX.Title = "系部名称"; foreach (GridViewRow gvr in GridView1.Rows) { Chart1.Series["旷课"].Points.AddXY(gvr.Cells[0].Text, gvr.Cells[3].Text.ToString()); Chart1.Series["迟到"].Points.AddXY(gvr.Cells[0].Text, gvr.Cells[5].Text.ToString()); Chart1.Series["早退"].Points.AddXY(gvr.Cells[0].Text, gvr.Cells[7].Text.ToString()); Chart1.Series["请假"].Points.AddXY(gvr.Cells[0].Text, gvr.Cells[9].Text.ToString()); Chart1.Series["总缺勤"].Points.AddXY(gvr.Cells[0].Text, gvr.Cells[11].Text.ToString()); } Chart1.Series["旷课"].Color = System.Drawing.Color.Red; Chart1.Series["迟到"].Color = System.Drawing.Color.Blue; Chart1.Series["早退"].Color = System.Drawing.Color.Green; Chart1.Series["请假"].Color = System.Drawing.Color.Orange; Chart1.Series["总缺勤"].Color=System.Drawing.Color.Black; Chart1.Series["旷课"]["PointWidth"] = "0.2"; Chart1.Series["迟到"]["PointWidth"] = "0.2"; Chart1.Series["请假"]["PointWidth"] = "0.2"; Chart1.Series["早退"]["PointWidth"] = "0.2"; Chart1.Series["总缺勤"]["PointWidth"] = "0.2"; Chart1.Legends.Add("lengend1"); //Chart1.ChartAreas["Series1"].Area3DStyle.Enable3D = true;3d样式 }
祥子爱游戏
2013-12-20
打赏
举报
回复
要我贴的代码吗?我是用一个area重复添加好几个gridview的数据
熙风
2013-12-20
打赏
举报
回复
明显是重复添加了,你看下你的代码
蝶恋花雨
2013-12-20
打赏
举报
回复
改成下面的试试 Chart1.Legends.Add(new Legend("Legend1"));
http://msdn.microsoft.com/en-us/library/dd456711%28VS.100%29.aspx
蝶恋花雨
2013-12-20
打赏
举报
回复
LegendCollection 检查有没有两个lengend1 。没有的话是不是在Add之前清除下。
祥子爱游戏
2013-12-20
打赏
举报
回复
大神们。还没起床吗
c# winForm
char
t控件动态更新 支持局部放大
在VS2010中,我们可以利用`Timer`控件来实现这
一点
。`MyTimer`可能就是用于触发数据更新和图表重绘的定时器。当定时器的`Tick`事件触发时,可以更新`
Char
t`控件的数据源,然后调用`Series.Points.Clear()`清空现有...
c#
char
t图形大小改变
char
tDemo.
Char
tAreas[0].AxisX.ScaleView.Position = series.Points.Count
char
tDemo.
Char
tAreas[0].AxisX.ScaleView.Size; //设置
char
t曲线实时变化 ③直线上每个点显示数值
char
t2.Series[0].Label = “#...
c#的
char
t标题_C#之
Char
t篇
叕叕叕到周五了,时间总是走的如此之快,不免伤感(- -)...1.第一个
Char
t控件1)先来熟悉一下
char
t,在前端做一个图表可能会用到
char
t.js,在C#中可以用自带的控件
char
t,感觉挺方便的。2)创建一个项目,windows窗体应...
C#之
Char
t篇
叕叕叕到周五了,时间总是走的如此之快,不免伤感(- -)。。...1)先来熟悉一下
char
t,在前端做一个图表可能会用到
char
t.js,在C#中可以用自带的控件
char
t,感觉挺方便的。 2)创建一个项目,windo
c#
char
t缩放,局部放大
效果:左键划选放大区域,右键恢复 /// <summary> /// 初始化,传入要进行初始化的
char
t ... public static void Init
Char
t (System.Windows.Forms.DataVisualization.
Char
ting.
Char
t ch.
图表区
4,819
社区成员
14,134
社区内容
发帖
与我相关
我的任务
图表区
.NET技术 图表区
复制链接
扫一扫
分享
社区描述
.NET技术 图表区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章