dear root helpdesk!
I’m working with root libraries within an ajax framework to present root plots via the web.
Right now i’m using the TH2D class to plot histograms.
the following problem:
my plot class gets a status string OK,ERROR,ND from a more lower framwork layer. the plot class assigns with a method a value to the string and these values are plotted in a root histogram (attached)
this is done as follows:
TPad* pad = (TPad*)gPad;
TH2D *h2 = new TH2D(“h2”,msg.str().c_str(),6,0.,6.,12,0.,12.) ;
h2->SetBinContent(binNrX, binNrY, averageRates_[wedgeInVec][boardNr]) ;
palette = (TPaletteAxis*)h2->GetListOfFunctions()->FindObject(“palette”);
palette->GetAxis()->SetTitle(“blue: not in the RUN - green: OK - red: ERROR”);
what i want is to have instead of numbers according to colors seen in the palette to have just a string (OK, ERROR, NOT IN THE RUN) assigned to the color. (right now it is done with setTitle() but it looks not that good and the numbers lead to misunderstandings).
Is it possible to modify the palette labeling in this way? (i tried to get rid of the numbers with TPaletteAxis class but i didn’t find a solution)
Or would you have a suggestion how to modify the canvas to get a kind of legend where one can assign the color of the palette with a name/string? (i also checked the TLegend class but i didn’t find a solution)
thanks for help