pike.git / lib / modules / Graphics.pmod / Graph.pmod / create_pie.pike

version» Context lines:

pike.git/lib/modules/Graphics.pmod/Graph.pmod/create_pie.pike:1:   //! Graph sub-module for drawing pie-charts. - // $Id: create_pie.pike,v 1.9 2003/11/22 15:00:54 grubba Exp $ + // $Id: create_pie.pike,v 1.10 2005/11/14 22:11:02 nilsson Exp $   //   // These functions were written by Henrik "Hedda" Wallin (hedda@roxen.com)   // Create_pie can draw pie charts in different forms.      #pike __REAL_VERSION__      #include "graph.h"      inherit "polyline.pike";   inherit "create_graph.pike";   inherit "create_bars.pike";      mapping(string:mixed) create_pie(mapping(string:mixed) diagram_data)   {    //Only tested with xsize>=100    int si=diagram_data["fontsize"];       string where_is_ax;    -  object(Image.image) piediagram; +  Image.Image piediagram;       init_bg(diagram_data);    piediagram=diagram_data["image"];    setinitcolors(diagram_data);       set_legend_size(diagram_data);       diagram_data["ysize"]-=diagram_data["legend_size"];       //Do the standard init (The init function is in create_graph)
pike.git/lib/modules/Graphics.pmod/Graph.pmod/create_pie.pike:92:    notext=GETFONT(xnamesfont);    if (names)    if (notext)    for(int i=0; i<sizeof(names); i++)    {    if ((names[i]!=0) && (names[i]!=""))    text[i]=notext    ->write(UNICODE((string)(names[i]),diagram_data["encoding"]))    ->scale(0,diagram_data["fontsize"]);    else -  text[i]=Image.image(diagram_data["fontsize"], +  text[i]=Image.Image(diagram_data["fontsize"],    diagram_data["fontsize"]);       if (text[i]->xsize()<1) -  text[i]=Image.image(diagram_data["fontsize"], +  text[i]=Image.Image(diagram_data["fontsize"],    diagram_data["fontsize"]);       if (text[i]->xsize()>diagram_data["xsize"]/5+diagram_data["3Ddepth"])    text[i]=text[i]->scale((int)diagram_data["xsize"]/5, 0);       if (text[i]->ysize()>diagram_data["ysize"]/5-diagram_data["3Ddepth"])    text[i]=text[i]->scale(0, (int)diagram_data["ysize"]/5-    diagram_data["3Ddepth"]);       if (xmaxtext<(text[i]->xsize()))
pike.git/lib/modules/Graphics.pmod/Graph.pmod/create_pie.pike:242:    //arrfoo[i]=arr2[i]+diagram_data["3Ddepth"];    for(int i=0; i<401; i++)    {    arrplus[2*i]=xc+(xr+w)*sin((i*2.0*PI/400.0)+FI);    arrplus[1+2*i]=yc+(w+yr)*sin(-PI/2+i*2.0*PI/400.0+FI);    arrpp[2*i]=xc+miniwxr*sin((-i*2.0*PI/400.0)+FI);    arrpp[1+2*i]=yc+miniwyr*sin(-PI/2-i*2.0*PI/400.0+FI)+    diagram_data["3Ddepth"];    }    object skugg; -  skugg=Image.image(piediagram->xsize(),piediagram->ysize(), 255,255,255); +  skugg=Image.Image(piediagram->xsize(),piediagram->ysize(), 255,255,255);    object foo; -  foo=Image.image(piediagram->xsize(),piediagram->ysize(), 255,255,255); +  foo=Image.Image(piediagram->xsize(),piediagram->ysize(), 255,255,255);    skugg->tuned_box(xc,yc-yr-1,xc+xr+1,1+yc+yr+diagram_data["3Ddepth"],    ({    ({255,255,255}),    ({100,100,100}),    ({255,255,255}),    ({100,100,100})    }));    skugg->tuned_box(xc-xr-1,yc-yr-1,xc,1+yc+yr+diagram_data["3Ddepth"],    ({    ({100,100,100}),
pike.git/lib/modules/Graphics.pmod/Graph.pmod/create_pie.pike:384:       object tbild;       int imxsize=piediagram->xsize(); //diagram_data["xsize"];    int imysize=piediagram->ysize(); //diagram_data["ysize"]+diagram_data["legendsize"];       if(tone)    {       -  tbild=Image.image(imxsize, imysize, 255, 255, 255)-> +  tbild=Image.Image(imxsize, imysize, 255, 255, 255)->    tuned_box(0, 0 , 1, imysize,    ({a,a,b,b}));    tbild=tbild->paste(tbild->copy(0,0,0, imysize), 1, 0);    tbild=tbild->paste(tbild->copy(0,0,1, imysize), 2, 0);    tbild=tbild->paste(tbild->copy(0,0,3, imysize), 4, 0);    tbild=tbild->paste(tbild->copy(0,0,7, imysize), 8, 0);    tbild=tbild->paste(tbild->copy(0,0,15, imysize), 16, 0);    if (imxsize>32)    tbild=tbild->paste(tbild->copy(0,0,31, imysize), 32, 0);