pavetext.C: Draw a pave text | Basic Graphics | pstable.C: Display all possible types of ROOT/Postscript characters |
void piechart() { // Pie chart example. //Authors: Olivier Couet, Guido Volpi Float_t vals[] = {.2,1.1,.6,.9,2.3}; Int_t colors[] = {2,3,4,5,6}; Int_t nvals = sizeof(vals)/sizeof(vals[0]); TCanvas *cpie = new TCanvas("cpie","TPie test",700,700); cpie->Divide(2,2); TPie *pie1 = new TPie("pie1", "Pie with offset and no colors",nvals,vals); TPie *pie2 = new TPie("pie2", "Pie with radial labels",nvals,vals,colors); TPie *pie3 = new TPie("pie3", "Pie with tangential labels",nvals,vals,colors); TPie *pie4 = new TPie("pie4", "Pie with verbose labels",nvals,vals,colors); cpie->cd(1); pie1->SetAngularOffset(30.); pie1->SetEntryRadiusOffset( 4, 0.1); pie1->SetRadius(.35); pie1->Draw("3d"); cpie->cd(2); pie2->SetEntryRadiusOffset(2,.05); pie2->SetEntryLineColor(2,2); pie2->SetEntryLineWidth(2,5); pie2->SetEntryLineStyle(2,2); pie2->SetEntryFillStyle(1,3030); pie2->SetCircle(.5,.45,.3); pie2->Draw("r"); cpie->cd(3); pie3->SetY(.32); pie3->GetSlice(0)->SetValue(.8); pie3->GetSlice(1)->SetFillStyle(3031); pie3->SetLabelsOffset(-.1); pie3->Draw("3d t nol"); TLegend *pieleg = pie3->MakeLegend(); pieleg->SetY1(.56); pieleg->SetY2(.86); cpie->cd(4); pie4->SetRadius(.2); pie4->SetLabelsOffset(.01); pie4->SetLabelFormat("#splitline{%val (%perc)}{%txt}"); pie4->Draw("nol <"); } piechart.C:1 piechart.C:2 piechart.C:3 piechart.C:4 piechart.C:5 piechart.C:6 piechart.C:7 piechart.C:8 piechart.C:9 piechart.C:10 piechart.C:11 piechart.C:12 piechart.C:13 piechart.C:14 piechart.C:15 piechart.C:16 piechart.C:17 piechart.C:18 piechart.C:19 piechart.C:20 piechart.C:21 piechart.C:22 piechart.C:23 piechart.C:24 piechart.C:25 piechart.C:26 piechart.C:27 piechart.C:28 piechart.C:29 piechart.C:30 piechart.C:31 piechart.C:32 piechart.C:33 piechart.C:34 piechart.C:35 piechart.C:36 piechart.C:37 piechart.C:38 piechart.C:39 piechart.C:40 piechart.C:41 piechart.C:42 piechart.C:43 piechart.C:44 piechart.C:45 piechart.C:46 piechart.C:47 piechart.C:48 piechart.C:49 piechart.C:50 piechart.C:51 piechart.C:52 |
|