Hello, everyone. Recently, when I used THttpServer to show a Canvas, I met a problem.
Referring to this example, I want to show a Canvas on the webpage. It works very well.
But when I want to show more histograms, it looks too small to see clearly. I hope that the scroll bar will be added to the canvas when I want to show more histograms on the webpage. How should I do? Does anyone have ideas?
THttpServer* serv = new THttpServer("http:8080");
TCanvas *C = new TCanvas("C","canvas");
h = new TH1F("histo","",100,-5.0,5.0);
for(int i=0; i<256; i++)
My ROOT Version: 6.24/06
My Platform: Centos7
My Compiler: 8.3.1 20190311 (Red Hat 8.3.1-3) (GCC)
Thanks in advance.
You are setting a canvas size of 1500 x 1500 pixels, and then dividing it into 8x32 pads. So each pad (for each histogram) only gets ~188x46 pixels. You would have to make the canvas much bigger to get bigger histograms. In any case, I don’t think it’s a good idea to have so many in one canvas, but I suppose it’s a matter of preference
Thank you. But when I set the canvas size of 15000*15000 pixels, it seems no change.
Size of canvas is ignored when displayed in the web browser by JSROOT - it always scaled to available space. You should try to create several canvas with less numbers of histograms per canvas
Thank you. If I create several canvases, I have another question.
How should I show them on the same webpage?
If you have too many histograms, you can not display them at once in reasonable way.
Therefore I proposed to create several canvas for them.
Each canvas can be displayed separately using all available space in web browser.
If you still want to display all histograms at once - you need to have TCanvas with many sub-pads.
But then you should se picture like that:
Thank you. I got it.
You mean that if I want to display all histograms at once, I cannot display them in normal size.
If I want to display them in normal size, I have to display them on different web pages.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.