I’d like to create a TRatioPlot with JSRoot. The class doesn’t seem available.
As a workaround, I thought to make a second histo below the original, and with a setInterval call, to update the xAxis range of the one wrt the other.
However, I don’t find yet how to (programmatically in JS) set the range of the axis/histo.
TRatioPlot is complicated class with several cross-references.
Therefore JSROOT does not provide method to create it.
I recommend to create it in the ROOT, store as JSON and then embed such JSON into JavaScript.
In such case you will be able to modify it to your need - including replacing of the content or changing axis labels.
Display of TRatioPlot should work. See several examples here:
for my current application, I handle objects directly online (online monitoring of histograms published in the experiment website), so I don’t really have an option for making ROOT files as it is; I could change the approach completely if all else fails.
Is there no way to handle the histo/canvas axis zoom from the xml object?
I guess you mean to make the dummy TRatioPlot in a root file that I can access, and then, within the xml object, I can access the internal histos that are plotted, and set them to what I make in the js code?
If yes, I think it makes sense, will try in a bit.
If not, then, please explain a bit more; I haven’t (js)root-ed in a long while and am rusty
Also, could you please point to where one can download the example root files that are linked under
maybe I miss something obvious, but I cannot find the tutorials folder. Would be nice to have a link in the main jsRoot pages
Until I find the json one, I load the TCanvas of a TRatioPlot from the ratioplot.root file, and I see the xml, but I don’t see yet what needs to be set to use my own histograms in place of the ones in canvas
I tried to set fH1 and fH2 under obj.fPrimitives.arr[3] (TRatioPlot), but it doesn’t change yet…)