web页上绘制饼图曲线图等组件(c#)

时间:2012-05-13 08:29:28
【文件属性】:

文件名称:web页上绘制饼图曲线图等组件(c#)

文件大小:136KB

文件格式:RAR

更新时间:2012-05-13 08:29:28

饼图曲线图

web页上绘制饼图曲线图等组件(c#) 例子: 生成饼图表******************************************** private void InitializeComponent() { this.myBarGraph.RenderGraph += new ZedGraph.Web.ZedGraphWebControlEventHandler(this.OnRenderGraphBar); this.myLineGraph.RenderGraph += new ZedGraph.Web.ZedGraphWebControlEventHandler(this.OnRenderGraphLine); } private void OnRenderGraphBar(ZedGraphWeb zgw, System.Drawing.Graphics g, ZedGraph.MasterPane masterPane) { myBarMethod(zgw, g, masterPane, strYear, strMonth, compareType); } private void OnRenderGraphLine(ZedGraphWeb zgw, System.Drawing.Graphics g, ZedGraph.MasterPane masterPane) { myLineMethod(zgw, g, masterPane, douYear, douMonth); } private void myBarMethod(ZedGraphWeb zgw, System.Drawing.Graphics g, ZedGraph.MasterPane masterPane, string[] strYear, string[] strMonth, string compareType) { GraphPane myPane = masterPane[0]; myPane.Title.Text = title + "柱状图分析"; myPane.XAxis.Title.Text = "时间(月/年)"; if (compareType == "AddValue") { myPane.YAxis.Title.Text = "增加值"; } else { myPane.YAxis.Title.Text = "增加比例(%)"; } List ListPointParitList = new List(); for (int i = 0; i < strYear.Length; i++) { ListPointParitList.Add(new PointPairList()); } int n = 0; for (double x = 0; x < strMonth.Length; x += 1.0) { for (int i = 0; i < strYear.Length; i++) { //ListPointParitList[i].Add(x, randNum[n++] * multiplyValue); ListPointParitList[i].Add(x, GetFXData(strYear[i], strMonth[(int)x])); } } List ListBarItem = new List(); List ListColor = GetColor(); for (int i = 0; i < strYear.Length; i++) { ListBarItem.Add(new BarItem(strYear[i], ListPointParitList[i], ListColor[i])); ListBarItem[i] = myPane.AddBar(strYear[i], ListPointParitList[i], ListColor[i]); } myPane.XAxis.MajorTic.IsBetweenLabels = true; myPane.XAxis.Scale.TextLabels = strMonth; myPane.XAxis.Type = AxisType.Text; myPane.Fill = new Fill(Color.White, Color.FromArgb(200, 200, 255), 45.0f); myPane.Chart.Fill = new Fill(Color.White, Color.LightGoldenrodYellow, 45.0f); masterPane.AxisChange(g); }


【文件预览】:
ZedGraph.Web.dll
ZedGraph.dll

网友评论

  • 资源不错~谢谢
  • 很有用,直接粘贴,稍作修改就可以用了!对初学者来说注释不够全
  • 有一定帮助的,学习学习
  • 不怎么好,没用
  • 不怎么详细 不太好
  • 没有很详细。不怎么好。
  • 适合初学者
  • 很有用,直接粘贴,稍作修改就可以用了!
  • 本身不用web的。下下来学习下。
  • 同意micheal1989的意见,我下载下来也没用。
  • 没有很详细。不怎么好。