tl;dr: Suppose you have multiple y values for the same x value in a TTree. Is there a way to get a CANDLE/VIOLIN of the y values at each x using TTree::Draw("y:x")?
Since TTree::Draw("y:x") creates a TGraph, the answer is “No” because a TGraph cannot be drawn as a CANDLE/VIOLIN. In fact, the output of TTree::Draw("y:x","","CANDLE") is two candles, one for y values and one for x values, which makes some sense.
OTOH, I was expecting TTree::Draw("y:x>>h(100,0,100,10,0,10)","","VIOLIN") to do the trick, since there is an histogramming step. Alas, that is not the case, even if the axes ranges now comply to the histogram specification.
That said, an ensuing gDirectory->Get("h")->Draw("CANDLE") works like a charm, so not all is lost.
So, all in all, I was wondering if this is all expected behaviour and if I am going about it in the most efficient way.
You cannot mean “ROOT generates […]” because that is falsified by the example I posted.
If you mean “The user should generate […]” then I still do not understand the logic through which TTree::Draw("y:x","","BOX") uses THistPainter (as you pointed out) but TTree::Draw("y:x","","VIOLIN") uses TGraphPainter.
The option VIOLIN is a “friend option” of the CANDLE option for histograms. It is valid for 2D histograms only. When you pass it to TTree::Draw it is not interpreted. Only the “L” of VIOLIN is seen, which explains the line plot you get.
So if you want to get a VIOLIN plot from the 2D histogram produced by the TTree::Draw() command, you should proceed as I described previously.
For curiosity I applied the patch you suggested in TTreePlayer. All I get is a ROOT crash.