cubicweb-jqplot #3183417 [JS] Handle ``legend: {'show': False}`` option [rejected]

When the legend option 'show' is set to False, the cube crashes, with:

TypeError: legendElem is undefined
      legendElem = legendElem.detach();

So, we need to check the variable is not undefined before detaching it.

priorityimportant
typebug
done in0.4.1
load0.000
load left0.000
closed by<not specified>
patch[js] Fix ``legend: {'show': False}`` option (closes #3183417). [folded]