Pictures of PHP can display a variety of graphical reports. Vertical graph, horizontal diagram, painting column chart, folding c

xiaoxiao2021-03-05  23

Case "1": $ this-> ImageColumns (); break; case "2": $ this-> imagecolumnh (); break; case "3": $ this-> imageline (); break; case "4": $ this-> imagecircle (); break;} $ this-> printxy (); $ this-> printall ();} // ----------- Print XY Carton Function Printxy () { $ rulery = $ rulerx = ""; // painting XY coordinate axis * / $ color = imagecolorallocate ($ this-> image, 255- $ this-> r, 255- $ this-> g, 255- $ this-> B); $ xx = $ this-> x / 10; $ yy = $ this-> y- $ this-> y / 10; imageline ($ this-> Image, $ this-> border, $ this-> border $ this-> border, $ this-> y- $ this-> border, $ color); // x-axis imageline ($ this-> Image, $ this-> border, $ this-> y- $ this- > Border, $ this-> X- $ this-> Border, $ this-> Y- $ this-> border, $ color); // Y-axis imageString ($ this-> Image, $ this-> fontsize, $ This-> border-2, $ this-> y- $ this-> border 5, "0", $ color); // Y axis scale $ rulery = $ this-> y- $ this-> border; $ I = 0; While ($ Rulery> $ this-> border * 2) {$ rulery = $ rulery- $ this-> border; imageline ($ this-> Image, $ this-> border, $ rulery, $ r This-> Border-2, $ Rulery, $ Color; if ($ this-> reporttype == 2) {// Horizon Map Image-> Fontsize, $ this-> border -10, $ Rulery-2- $ THIS-> Border * ($ I .5), $ this-> Numx, $ Color; $ this-> Numx = $ this-> stepx;} $ i ;} / / X-axis scale $ rulerx = $ rulerx $ this-> border; $ i = 0; while ($ RULERX <-> x $ this-> border * 2)) {$ rulerx = $ rulerx $ THIS -> Border; // Imageline ($ this-> Image, $ this-> Border, 10, $ this->

Border 10, 10, $ Color; Imageline ($ this-> Image, $ RULERX, $ THIS-> Y- $ THIS-> Border, $ RULERX, $ this-> Y- $ this-> border 2, $ color); // Durable value IF ($ this-> reporttype == 1) {// Vertical Pillar image ImageString ($ this-> Image, $ this-> Fontsize, $ RULERX-2 $ this-> border * ($ I .5), $ this-> Y- $ this-> Border 5, $ this-> Numx, $ color); $ this-> Numx = $ this-> stepx;} else f ($ this -> ReportType == 3) {// foldline diagram ImageString ($ this-> Image, $ this-> Fontsize, $ RULERX-2, $ THIS-> Y- $ THIS-> Border 5, $ this-> NUMX $ color); $ this-> Numx = $ this-> stepx;} $ i ;}} // -------------------------------------------------------------------------------------------------------------------------- Item_Array = Split ($ THIS-> ARRAYSPLIT, $ THIS-> ITEMARRAY); $ Num = Count ($ Item_Array); $ ITEM_MAX = 0; for ($ I = 0; $ i <$ NUM; $ I ) {$ Item_MAX = Max ($ ITEM_MAX, $ Item_Array [$ I]);} $ xx = $ this-> border * 2; // Section Picture For ($ I = 0; $ i <$ NUM; $ I ) {SRAND ((Double) microtime () * 1000000); if ($ this-> r! = 255 && $ this-> g! = 255 && $ this-> b! = 255) {$ r = rand ($ this-> R, 200); $ g = rand ($ this-> g, 200); $ B = RAND ($ THIS-> B, 200);} else {$ r = rand (50,200); $ g = rand (50, 200); $ b = rand (50, 200);} $ color = imagecolorallocate ($ this-> Image, $ R, $ G, $ B); // Cylindrical height $ height = ($ this-> Y- $ THIS-> Border) - ($ this-> y- $ this-> border * 2) * ($ ITEM_ARRAY [$ I); ImageFilledRectangle ($ THIS-> Image, $ XX, $ HEIGHT, $ XX $ THIS-> Border, $ THIS-> Y- $ THIS-> Border, $ Color; Imagestring ($ this-> Image, $ this-> Fontsize, $ XX, $ HEIGHT- $ THIS->

Border, $ ITEM_ARRAY [$ I], $ this-> fontcolor); // Used for spacing $ xx = $ xx $ this-> border * 2;}} // --------- Cylindrical diagram function imagecolumnh () {$ ITEM_ARRAY = Split ($ this-> arraysplit, $ this-> itemRray); $ Num = Count ($ item_ARRAY); $ item_max = 0; for ($ I = 0; $ i < $ NUM; $ I ) {$ Item_Max = Max ($ Item_MAX, $ Item_Array [$ I]);} $ yy = $ this-> y- $ this-> border * 2; // Picture Map for ($ i = 0; $ i <$ NUM; $ I ) {SRAND ((Double) microtime () * 1000000); if ($ this-> r! = 255 && $ this-> g! = 255 && $ this-> B! = 255) {$ r = rand ($ this-> r, 200); $ g = rand ($ this-> g, 200); $ b = rand ($ this-> b, 200);} else {$ R = Rand (50,200); $ g = rand (50, 200); $ b = rand (50, 200); $ color = imagecolorallocate ($ this-> Image, $ r, $ g, $ b); // column Leight = ($ this-> x- $ this-> border * 2) * ($ Item_Array [$ I] / $ item_max); $ getight = $ this-> border? $ This-> border : $ this-> Image, $ THIS-> Border, $ YY- $ THIS-> Border, $ Leight, $ YY, $ color); $ this-> Image, $ this-> FONTSIZE, $ Leight 2, $ YY- $ this-> Border, $ Item_Array [$ I], $ this-> fontcolor); // Used for spacing $ yy = $ yy- $ this-> border * 2;} } // -------------- Parker diagram function imageline () {$ item_array = split ($ this-> arraysplit, $ this-> itemRay); $ Num = Count ($ item_Array) $ Item_max = 0; for ($ I = 0; $ I <$ NUM; $ I ) {$ Item_Max = Max ($ Item_MAX, $ Item_Array [$ I]);} $ xx = $ this-> border; / / Pie Column Map for ($ I = 0; $ I <$ NUM; $ I ) {SRAND ((Double) Microtime () * 1000000); if ($ this-> r! =

255 && $ this-> g! = 255 && $ this-> b! = 255) {$ r = rand ($ THIS-> R, 200); $ g = rand ($ this-> g, 200); $ B = RAND ($ THIS-> B, 200);} else {$ r = rand (50,200); $ g = rand (50, 200); $ b = rand (50, 200);} $ color = imagecolorallocate ($ this-> Image, $ r, $ g, $ b); // Cylindrical height $ height_now = ($ this-> Y- $ this-> border) - ($ this-> y- $ this-> border * 2) * ($ I) / $ ITEM_MAX; IF ($ I! = "0") ImagelineLine ($ this-> Image, $ XX- $ THIS-> Border, $ HEIGHT_NEXT, $ XX, $ HEIGHT_NOW, $ Color Imagestring ($ this-> Image, $ this-> Fontsize, $ XX 2, $ HEIGHT_NOW- $ THIS-> Border / 2, $ Item_Array [$ I], $ THIS-> FontColor); $ Height_Next = $ $ HEIGHT_NEXT = $ Height_now; // Used for spacing $ xx = $ xx $ this-> border;}} // ------------ Both pie chart function imagecircle () {$ Total = 0; Item_Array = Split ($ THIS-> ARRAYSPLIT, $ THIS-> ITEMARRAY); $ Num = Count ($ Item_Array); $ ITEM_MAX = 0; for ($ I = 0; $ i <$ NUM; $ I ) {$ Item_MAX = Max ($ ITEM_MAX, $ Item_Array [$ I]); $ TOTAL = $ Item_Array [$ I];} $ yy = $ this-> y- $ this-> border * 2; // Crawler chart The shadow portion is $ E = 0; for ($ I = 0; $ i <$ num; $ i ) {srand ((double) microtime () * 1000000); if ($ this-> r! = 255 && $ THIS -> g! = 255 && $ this-> b! = 255) {$ r = rand ($ this-> r, 200); $ g = rand ($ this-> g, 200); $ b = rand ( $ this-> b, 200);} else {$ r = rand (50,200); $ g = rand (50, 200); $ b = rand (50, 200);} $ s = $ e; $ get = $ itm_array [$ I] / $ TOTAL * 360; $ E = $ S $ Leight; $ Color = ImageColoralLocate ($ this-> Image, $ R, $ G, $ B);

$ Colorarray [$ I] = $ color; // draw round for ($ J = 90; $ J> 70; $ J -) ImageFilleDarc ($ this-> Image, 110, $ J, 200, 100, $ s $ E, $ Color, IMG_ARC_PIE); // ImageFilledarc ($ this-> Image, 110, 70, 200, 100, $ s, $ e, $ color, img_arc_pie); // imagefilledRectangle ($ this-> image, $ this-> Border, $ YY- $ THIS-> Border, $ Leight, $ yy, $ color); // imagestring ($ this-> Image, $ this-> Fontsize, $ Leight 2, $ yy- $ yy- $ l 2 This-> Border, $ ITEM_ARRAY [$ I], $ this-> fontcolor); // Used for spacing $ yy = $ yy- $ this-> border * 2;} // Surface part of the painting chart $ E = 0; for ($ I = 0; $ I <$ NUM; $ I ) {SRAND ((Double) Microtime () * 1000000); if ($ this-> r! = 255 && $ this-> g! = 255 && $ this-> b! = 255) {$ r = rand ($ this-> r, 200); $ g = rand ($ this-> g, 200); $ b = rand ($ this-> B , 200);} else {$ r = rand (50,200); $ g = rand (50, 200); $ b = rand (50, 200);} $ s = $ e; $ level = $ itm_array [$ I] / $ TOTAL * 360; $ E = $ S $ Leight; // $ color = $ Colorarray [$ I]; $ color = imagecolorallocate ($ this-> image, $ r, $ g, $ b); // draw round // For ($ j = 90; $ j> $ J -) Imagefilledarc ($ THIS-> Image, 110, $ J, 200, 100, $ S, $ E, $ Color, IMG_ARC_PIE); ImageFilleDarc ($ this-> Image, 110, 70, 200, 100, $ S, $ E, $ Color, IMG_ARC_PIE);}} // -------------- Complete Print Graph Function Printall () {ImagePng ($ this-> image); ImageDestroy ($ this-> image);} // -------------- debug function debug () {echo "x:". $ this-> x. "Y: $ this-> y; echo "Border:". $ this-> border; $ item_ARRAY = Split ($ this-> arraysplit, $ this-> itemRay); $ Num = Count ($ item_ARRAY) ;

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

New Post(0)