SharpMap + ZedGraph 饼图实例,可生成各种统计图
//Set visible map extents map.Center = new SharpMap.Geometries.Point(centerX, centerY); map.Zoom = Zoom; //Generate map System.Drawing.Bitmap img = (System.Drawing.Bitmap)map.GetMap(); //Stream the image to the client context.Response.ContentType = "image/png"; System.IO.MemoryStream MS = new System.IO.MemoryStream(); img.Save(MS, System.Drawing.Imaging.ImageFormat.Png); // tidy up img.Dispose(); byte[] buffer = MS.ToArray(); context.Response.OutputStream.Write(buffer, 0, buffer.Length); p ublic SharpMap.Styles.VectorStyle GetChartingStyle(SharpMap.Data.FeatureDataRow row) { SharpMap.Styles.VectorStyle style = new SharpMap.Styles.VectorStyle(); int numMale = int.Parse(row["male"].ToString()); int numFemale = int.Parse(row["female"].ToString()); style.Symbol = this.GetChart(numMale, numFemale); return style; }
文件列表
SimpleChart.zip
(预估有个25文件)
SimpleChart
App_Code
MapHelper.cs
14KB
SimpleChart.aspx.cs
4KB
Web.Config
7KB
App_Data
cities.SHX
4KB
rivers.shx
884B
countries.shp
449KB
rivers.dbf
8KB
用户评论