Which JSROOT version you are using?
Can you check output of browser console? You can activate it with Ctrl + Shift + F11.
And as last - can you provide your ROOT file?
Also I found what was causing the problem (but don’t know how to fix it)
TFile f("test.root");
ntuples->Draw("x:y:z:w>>PlotHist");
c1->SaveAs("c1.root"); // This works with JSROOT (I see axes and data)
// SETTING TITLES MAKES THE CANVAS EMPTY
auto c2 = new TCanvas("c2", "Detection Position", 600, 600);
PlotHist->SetTitle("Position; Z;Y;X");
PlotHist->SetStats(0);
c2->cd();
PlotHist->Draw();
c2->SaveAs("c2.root"); // This does not render completely. Just the axes is visible
Sergey,
Thanks for your reply.
I am a little confused by the answer however. This (that I can see test.root and c1.root, but not c2.root) is my problem. In your links, c2.root is still not visible. So phrased differently, how do you make c2 visible, either by changing markersize or otherwise? c2 is visible when using root from command line.
Thanks
The inevitable follow up question is then how do you save the points/entries from the histogram to the canvas?
From my point of view, I am drawing two histograms, saving them to two different root files. One renders and the other one doesn’t. The only difference with the other being that I set the title.
With regular root (ie run on command line, hist->Draw() produces the right visual.
Thanks for the explanation.
One more question: This works inspite of being a 4-D hist. The only difference I see is that I am setting a title in the case where it fails.
TTree *t = new TTree("t", "testdata.csv");
t->ReadFile("testdata.csv", "x:y:z:w");
t->Draw("x : y : z : w>>hist");
c1->SaveAs("c1.root")
The histogram drawn to c1 is also 4d, and yet it works.