void gradients(bool gl = true)
{
auto c =
new TCanvas(
"cpie",
"Gradient colours demo", 700, 700);
if (!
c->UseGL() && !
c->IsWeb())
::Warning(
"gradients",
"This macro requires either OpenGL or Web canvas to correctly handle gradient colors");
auto t =
new TText(0.05, 0.7,
"Can you see the text?");
t->Draw();
auto pad =
new TPad(
"p",
"p", 0., 0., 1., 1.);
pad->SetFillColor(transparentFill);
pad->Draw();
pad->cd();
c->SetFillColor(linearFill);
Double_t values[nSlices] = {0.8, 1.2, 1.2, 0.8, 1.};
Int_t colors[nSlices] = {radialFill, radialFill, radialFill, radialFill, radialFill};
}
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
R__EXTERN TStyle * gStyle
static Int_t GetLinearGradient(Double_t angle, const std::vector< Int_t > &colors, const std::vector< Double_t > &positions={})
Static function: Returns the linear gradient color number corresponding to specified parameters.
static Int_t GetRadialGradient(Double_t r, const std::vector< Int_t > &colors, const std::vector< Double_t > &positions={})
Static function: Returns the radial gradient color number corresponding to specified parameters.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
The most important graphics class in the ROOT system.
void SetLabelsOffset(Float_t)
Set the distance between the label end the external line of the TPie.
void SetEntryRadiusOffset(Int_t, Double_t)
Set the distance, in the direction of the radius of the slice.
void SetRadius(Double_t)
Set the pie chart's radius' value.
void Draw(Option_t *option="l") override
Draw the pie chart.
void SetCanvasPreferGL(Bool_t prefer=kTRUE)
Base class for several text objects.