Custom Tooltips

Hi,

Please could you give me an example for how to show a tooltip for a JSROOT object (eg filled circle) on a TCanvas?

Is the “polar” drawing option supported for 2D histograms in JSROOT?

Please could you tell me how to replace a histogram’s Tooltip text? I found an example which suggests adding extra array elements, but I could not figure out how to add the extra information to each bin in the histogram, and also I would like to hide the x and y output.

Thanks for your help!
Naomi.

Hi Naomi,

No, “polar” draw option is not implemented for TH2 classes. I will add it to my to do list.

This will require some JavaScript programing. One can redefine TH2Painter::processTooltipEvent method to return some custom infos or just remove some lines.

Basic ROOT classes like TMarker or TEllipse does not have title, therefore tooltips handling does not implemented for them. One can use TGraph “p” draw option and modify tooltips handling there.

I will provide soon example how tooltip handler for some class can be modified.
And will try to implement “polar” draw option.

Regards,
Sergey

Hi Naomi,

I provide demo which customize tooltips in TH2 and TGraph painter.

One can see it here: JavaScript ROOT API examples

And source code here: jsroot/demo/tooltip_lines.htm at master · root-project/jsroot · GitHub

Let me know if it fit your need concerning tooltips

Regards,
Sergey

Thank you! I will try it.

Naomi.

Hi Naomi,

Are you really using “pol” draw option with TH2?
I just check how it implemented in ROOT and think that it does not work properly.
Therefore I plan to change how it is works - see my PR: Change implementation of "pol" painting for TH2 by linev · Pull Request #17796 · root-project/root · GitHub

And then I will provide functionality in JSROOT.
Preliminary look and feel you can find here: JavaScript ROOT examples

Regards,
Sergey