I am using JSROOT to display several TMultiGraphs online. Without legends, they look ok, but I need legends. I am reading the multigraphs from a root file and constructing the legends in JS.
All of these multigraphs have x-values starting above zero. Without the legends, the autorange works nicely and the graph automatically shows a sensible x-axis range. When I started to add legends, this changed unexpectedly.
I find that when I draw each multigraph before its legend, then just the first multigraph gets its x-axis range reset to start at 0. However if I draw each legend before its multigraph, then all of the multigraphs unexpectedly have their x-axis reset to start at 0.
It looks like the TGraphPainter’s xmin is getting overwritten but Idk if that is my fault or JSROOT’s.
How can I reset the x-axis to my preferred values?
The JSROOT example on zooming didn’t seem to be directly applicable to multigraphs. Also it was a bit too complicated. I would really like an example to modify that does something like GetXaxis()->SetRangeUser(3,5), if anyone has a code snippet to share, I’d be grateful.