请教一个matplotlib 绘制多图图zedGraph的问题

匿名用户不能发表回复!|使用ZedGraph制作动态更新的统计图_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
使用ZedGraph制作动态更新的统计图
阅读已结束,下载本文需要
想免费下载更多文档?
定制HR最喜欢的简历
你可能喜欢Imports ZedGraph
Imports System.Drawing
Public Class graph
&&& Inherits System.Web.UI.Page
&&& Dim ls_projid As String = ""
&&& Protected Sub ZedGraphWeb2_RenderGraph(ByVal z As ZedGraph.Web.ZedGraphWeb, _
&&&&&&&&&&&&&&& ByVal g As System.Drawing.Graphics, _
&&&&&&&&&&&&&&& ByVal masterPane As ZedGraph.MasterPane) Handles ZedGraphWeb2.RenderGraph
&&&&&&& ' Get the GraphPane so we can work with it
&&&&&&& Dim myPane As GraphPane = masterPane(0)
&&&&&&& ' Set the titles and axis labels
&&&&&&& myPane.Title.Text = "项目进度报表"
&&&&&&& myPane.XAxis.Title.Text = "日期"
&&&&&&& myPane.YAxis.Title.Text = "进度"
&&&&&&& '进度条0 - 100
&&&&&&& myPane.YAxis.Scale.Min = 0
&&&&&&& myPane.YAxis.Scale.Max = 100
&&&&&&& 'myPane.YAxis.Scale.MinGrace = 0.2
&&&&&&& 'myPane.YAxis.Scale.MaxGrace = 0.2
&&&&&&& 'myPane.Y2Axis.Scale.MinGrace = 0.2
&&&&&&& 'myPane.Y2Axis.Scale.MaxGrace = 0.2
&&&&&&& ' Make up some data points from the Sine function
&&&&&&& Dim list As New PointPairList()
&&&&&&& Dim list2 As New PointPairList()
&&&&&&& Dim i As Integer, x As Double, y As Double, y2 As Double
&&&&&&& Dim d As Date
&&&&&&& '取得对应的ID号
&&&&&&& Dim ds As DataSet
&&&&&&& ds = Config.GetDs("select AchieveDate,TargetProgress,FactProgress from tbl_projectprogress where Id_InProject='" & ls_projid & "' order by AchieveDate")
&&&&&&& If ds.Tables(0).Rows.Count & 0 Then
&&&&&&&&&&& For i = 0 To ds.Tables(0).Rows.Count - 1
&&&&&&&&&&&&&&& d = ds.Tables(0).Rows(i)("AchieveDate")
&&&&&&&&&&&&&&& x = New XDate(d)
&&&&&&&&&&&&&&& y = ds.Tables(0).Rows(i)("TargetProgress")
&&&&&&&&&&&&&&& y2 = ds.Tables(0).Rows(i)("FactProgress")
&&&&&&&&&&&&&&& list.Add(x, y)
&&&&&&&&&&&&&&& list2.Add(x, y2)
&&&&&&&&&&& Next i
&&&&&&& End If
&&&&&&& 'd = ""
&&&&&&& 'x = New XDate(d)
&&&&&&& 'y = 10
&&&&&&& 'y2 = 5
&&&&&&& 'list.Add(x, y)
&&&&&&& 'list2.Add(x, y2)
&&&&&&& 'For i = 0 To 35
&&&&&&& '&&& x = New XDate(1995, i + 1, 1)
&&&&&&& '&&& y = Math.Sin(i * Math.PI / 15.0)
&&&&&&& '&&& y2 = 2 * y
&&&&&&& '&&& list.Add(x, y)
&&&&&&& '&&& list2.Add(x, y2)
&&&&&&& 'Next i
&&&&&&& ' Generate a blue curve with circle symbols, and "My Curve 2" in the legend
&&&&&&& Dim myCurve2 As LineItem = myPane.AddCurve("目标进度", list, Color.Blue, _
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& SymbolType.Circle)
&&&&&&& ' Fill the area under the curve with a white-red gradient at 45 degrees
&&&&&&& 'myCurve2.Line.Fill = New Fill(Color.White, Color.Red, 45.0F)
&&&&&&& ' Make the symbols opaque by filling them with white
&&&&&&& myCurve2.Symbol.Fill = New Fill(Color.White)
&&&&&&& ' Generate a red curve with diamond symbols, and "My Curve" in the legend
&&&&&&& Dim myCurve As LineItem = myPane.AddCurve("实际进度", _
&&&&&&&&&&& list2, Color.MediumVioletRed, SymbolType.Diamond)
&&&&&&& ' Fill the area under the curve with a white-green gradient
&&&&&&& 'myCurve.Line.Fill = New Fill(Color.White, Color.Green)
&&&&&&& ' Make the symbols opaque by filling them with white
&&&&&&& myCurve.Symbol.Fill = New Fill(Color.White)
&&&&&&& ' Set the XAxis to date type
&&&&&&& myPane.XAxis.Type = AxisType.Date
&&&&&&& myPane.XAxis.CrossAuto = True
&&&&&&& ' Fill the axis background with a color gradient
&&&&&&& myPane.Chart.Fill = New Fill(Color.White, Color.LightGoldenrodYellow, 45.0F)
&&&&&&& masterPane.AxisChange(g)
&&& End Sub
&&& Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
&&&&&&& If Not Page.IsPostBack Then
&&&&&&&&&&& Dim sqlstr As String
&&&&&&&&&&& Dim ds As DataSet
&&&&&&&&&&& Dim i As Integer
&&&&&&&&&&& sqlstr = "select id,itemdes from dbo.tbl_project where parentid='0' and status='1'"
&&&&&&&&&&& ds = Config.GetDs(sqlstr)
&&&&&&&&&&& drpProject.Items.Add("请选择")
&&&&&&&&&&& drpProject.Items(0).Value = ""
&&&&&&&&&&& If ds.Tables(0).Rows.Count & 0 Then
&&&&&&&&&&&&&&& For i = 0 To ds.Tables(0).Rows.Count - 1
&&&&&&&&&&&&&&&&&&& drpProject.Items.Add(ds.Tables(0).Rows(i)("itemdes"))
&&&&&&&&&&&&&&&&&&& drpProject.Items(i + 1).Value = ds.Tables(0).Rows(i)("id")
&&&&&&&&&&&&&&& Next i
&&&&&&&&&&& End If
&&&&&&& End If
&&& End Sub
&&& Protected Sub cmdShow_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdShow.Click
&&&&&&& ls_projid = drpProject.SelectedValue
&&& End Sub
阅读(...) 评论()2011年9月 总版技术专家分月排行榜第一2011年8月 总版技术专家分月排行榜第一2011年7月 总版技术专家分月排行榜第一2011年6月 总版技术专家分月排行榜第一2011年5月 总版技术专家分月排行榜第一2011年4月 总版技术专家分月排行榜第一
2011年3月 总版技术专家分月排行榜第二2011年2月 总版技术专家分月排行榜第二
2009年2月 .NET技术大版内专家分月排行榜第三
匿名用户不能发表回复!|当前位置: →
→ C#中zedgraph作图的图中怎样显示文本和变量值
C#中zedgraph作图的图中怎样显示文本和变量值
& 作者:佚名 & 来源: 互联网 & 热度:
&收藏到→_→:
摘要: C#中zedgraph绘制的图中怎样显示文本和变量值C#中zedgraph绘制的图中怎样显示文本和变量值如图:就像这图片X轴坐标下的数字和变...
"C#中zedgraph作图的图中怎样显示文本和变量值"::
c#中zedgraph绘制的图中怎样显示文本和变量值c#中zedgraph绘制的图中怎样显示文本和变量值如图:就像这图片x轴坐标下的数字和变量是怎样添加上的那?------解决方案--------------------图片没有显示,不知道你是不是想在图中节点旁边显示点的坐标信息
// 点位和标注的偏置
const double offset = 10;
// 为每个点加标注
for (int i = 0; i & 36; i++)
pointpair pt = mycurve.points[i];
textobj text = new textobj(pt.y.tostring(&f2&), pt.x, pt.y + offset, coordtype.axisxyscale, alignh.left, alignv.center);
text.zorder = zorder.a_
// 隐藏标注的边框和填充
text.fontspec.border.isvisible =
text.fontspec.fill.isvisible =
// 选择标注字体90°
text.fontspec.angle = 90;
mypane.graphobjlist.add(text);
------解决方案--------------------探讨c#中zedgraph绘制的图中怎样显示文本和变量值如图:就像这图片x轴坐标下的数字和变量是怎样添加上的那? 搜索此文相关文章:中zedgraph作图的图中怎样显示文本和变量值此文来自: 马开东博客
网址: 站长QQ
上一篇:没有了
C#中zedgraph作图的图中怎样显示文本和变量值_C#技术相关文章
C#技术_总排行榜
C#技术_最新
C#技术_月排行榜
C#技术_周排行榜
C#技术_日排行榜}

我要回帖

更多关于 matplotlib 绘制多图 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信