1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
//////////////////////////////
// Fichier entete
//////////////////////////////
#ifndef _BSCHART_H
#define _BSCHART_H
#define CEXTERN __declspec (dllexport)
typedef unsigned int Uint32;
typedef const char * QChar;
typedef double UDbl32;
typedef struct
{
int x,y,r;
} bs_Point ;
typedef struct
{
Uint32 W,H; // With * Hight
char *Bg; // image BG
bs_Point P; // Pie Coordinate
char *Tl; // Title of Image
Uint32 Ex; // Explode Bloc
} bs_PieChart;
CEXTERN bool bsDrwPieChart(bs_PieChart,QChar *,UDbl32 *,char *,Uint32 );
#endif
//////////////////////////////////////
// Source ...
/////////////////////////////////////
#include "bsChart.h"
#include "chartdir.h"
bool bsDrwPieChart(bs_PieChart t,QChar *m,UDbl32 *d,char *fn,Uint32 n)
{
PieChart *c = new PieChart(t.W,t.H);
c->setPieSize ( t.P.x , t.P.y , t.P.r );
c->set3D(15);
c->setRoundedFrame();
c->addTitle(t.Tl,"Timesbi.ttf", 15/*t.fz*/)->setBackground(0xccccff, 0x000000, Chart::glassEffect());
c->setWallpaper ( t.Bg );
c->setColors ( Chart::transparentPalette );
TextBox *Q = c->setLabelStyle();
Q->setBackground(Chart::SameAsMainColor, Chart::Transparent, Chart::glassEffect() );
Q->setRoundedCorners(5);
c->setLineColor(Chart::SameAsMainColor, 0x000000);
c->setStartAngle(45);
c->setData ( DoubleArray(d,n) , StringArray(m,n) );
c->setExplode ( t.Ex );
return ( c->makeChart(fn) );
delete c;
} |
Partager