C # Implement pie chart and album map

xiaoxiao2021-03-06  79

using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls Using system.Web.ui.htmlcontrols;

Namespace XCRM.Module.Report {///

/// DRAW Summary Description. /// public class draw: system.Web.ui.page {private void page_load (Object sender, system.eventargs e) {// Place user code here to initialize page draw_imgbar ();} // British void Draw_imgbar () {// Create a Bitmap instance of a length of 400, broadband 400 Bitmap bmp = new bitmap (400, 300); graphics g; g = graphics.fromImage (bmp); g.clear ); String [] SITEM = {"Very Good", "Good", "General", "Poor"}; int [] Num = {1000, 69, 90, 2000}; int CNT, I, Len, Ibarwidth; Float scale; float [] nflt; string header; header = ""; cnt = 0; IbarWidth = 40; scale = 1; len = Num.length; //nflt.length = len; nflt = new float [len]; For (i = 0; i

Header = "Survey Statist Results List"; G. DrawString (Header, New Font ("Song Body", 12, FontStyle.Bold, Brushes.black, New Point (75, 10)); Point MyRec = New Point (300 , 40); Point MyDec = New Point (320, 40);

For (i = 0; i

// s = s NFLT [I];} Pen P = New Pen (Color.Black, 1); g. DrawRectangle (P, 1, 1, 398, 298); bmp.save (Response.outputStream, System. Drawing.Imaging.imageFormat.jpeg); bmp.dispose ();

// Painted pie chart void Draw_img () {bitmap bmp = new bitmap (400, 300); // Create a BitMap instance of 400, broadband is 400, GRAPHMAP instance graphics g; g = graphics.FromImage (bmp); g.clear . Snow); String [] Sitem = {"Very Good", "Good", "General", "Poor"}; int [] Num = {1000, 69, 90, 20}; int CNT, I, Len; Float S; float [] nflt; string header; header = ""; cnt = 0; s = 0; len = Num.Length; //nflt.LENGTH = LEN; nflt = new float [len]; for (i = 0; i

Point MyRec = New Point (300, 40); Point MyDec = New Point (320, 40);

For (i = 0; i

G.Fillpie (New Solidbrush (Return_Color (I)), 50, 50, 200, 200, S, NFLT [I]); G.Drawpie (Pens.Black, 50, 50, 200, 200, s, nflt [i ]); S = s NFLT [I];} Pen P = new Pen (Color.Black, 1); g. DrawRectangle (P, 1, 1, 398, 298); bmp.save (Response.OutputStream, System, System .Drawing.image.imageformat.jpeg);} public color return_color (INT i) {switch (i) {case 0: return color.red; // Break; case 1: return color.blue; // Break; case 2 : Return Color.Yellow; Case 3: Return Color.green; // Break; Case 4: Return Color.pink; // Break; Case 5: Return Color.plum; // Break; Case 6: Return Color.gray; // Break; Case 7: return color.salmon; // Break; case 8: return color.rosybrown; // Break; cas 9: return; case 10: return color.range; // Break; Case 11: Return color.thistle; // Break; Case 12: Return Color.m Aroon; // Break; default: Return Color.whitesmoke; // Break;} #Region Web Form Designer Generated Code Override Protected Void OnInit (Eventargs E) {// // Codegen: This call is ASP.NET Web Form Designer is required. // InitializeComponent (); base.onit (e);} ///

/// Designer Supports the required method - Do not use the code editor to modify the // / this method. /// private void initializecomponent () {this.load = new system.eventhandler (this.page_load);} #ENDREGON}}

转载请注明原文地址:https://www.9cbs.com/read-88835.html

New Post(0)