JSRoot addition of multiple histograms

Hi,
How can I add multiple histograms created from json, with jsroot?
I tried to use “object.Add()”. But I get a “this is not a function” error. Any advice?

Best,
Guilherme

Hi Guilherme,

If you want to draw several histograms in jsroot, I recommend to use THStack class.
Either you create it in ROOT and save in the file.
Or you can create THStack directly in JSROOT, as in the example:

https://root.cern/js/latest/api.htm#custom_html_thstack
https://root.cern/js/latest/api.htm#custom_html_thstack_src

In the example histograms are created as well, but you can load them from the ROOT file, as shown in other example:

https://root.cern/js/latest/api.htm#custom_html_read_root_file

Regards,
Sergey

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.