JSROOT drawing with Log X option different from that of ROOT

Hello, ROOT developers

JSROOT drawing with Log X option is different from that of ROOT
If possible, could you fix it?

Thanks in advance


This problem is fixed now. Result you can see here:


Later today code will be in ROOT repository (there are some other changes).

Thank you for reporting it.


Thank you for a quick fix.

My intention was to monitor FADC pulse and its FFT using JSROOT.

I thought that everyting would go well if Log X drawing issue were solved.
After I applied your fix, I compared ROOTJS drawing to ROOT like this

I suspect too fine binning might cause the difference.

What do you think the difference come from?

I attach root files
fft.root (144 KB)
pulse.root (27.3 KB)

I found zooming in shows the exact same drawing as to pulse.

Best regards

Dear Hyunok,

You hit problem with drawing optimization in JSROOT.
Fact is that SVG graphic in browsers extremely slow when drawing line with several thousands points.
Therefore in JSROOT I try to reduce number of drawn points to approx number of pixels.
And my implementation was not perfect, especially for the case of double-log scales.
Now it should work better - please try this:



You could compare performance without optimization:



And when you zoom in, optimization is no longer necessary.
JSROOT just shows all visible points as they are.

Later I will provide fixes in ROOT repository.


Dear Sergey

I will apply your fix to my daq program afterwards.
Thank you for your quick response again

I have another issue.
I can’t draw histogram with option “p” or “p0”.

I think you can fix the issue easily because drawing with option ‘e’ works well.
I attach macro file used for marker test.

Best regards
httpserver.C (2.67 KB)

Dear Hyunok,

Now ‘P’ and ‘P0’ should work with TH1 class. Like:



Dear Sergey

Thank you for your sincere replies again.
I think your fixes are absolutely helpful to implement my daq program.

Best regards