From 4ab202dc71c400326f649750f3750c10e3950a6c Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Fri, 4 Jan 2019 10:12:54 -0500 Subject: [PATCH] better default order for multiple hovers --- src/traces/box/hover.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/traces/box/hover.js b/src/traces/box/hover.js index 05ca7310261..a6a2f518137 100644 --- a/src/traces/box/hover.js +++ b/src/traces/box/hover.js @@ -145,15 +145,26 @@ function hoverOnBoxes(pointData, xval, yval, hovermode) { // box plots: each "point" gets many labels var usedVals = {}; - var attrs = ['med', 'min', 'q1', 'q3', 'max']; + var attrs = ['min']; + + if(trace.boxpoints || trace.points) { + attrs.push('lf'); + } + + attrs.push('q1', 'med'); if(trace.boxmean || (trace.meanline || {}).visible) { attrs.push('mean'); } + + attrs.push('q3'); + if(trace.boxpoints || trace.points) { - attrs.push('lf', 'uf'); + attrs.push('uf'); } + attrs.push('max'); + for(var i = 0; i < attrs.length; i++) { var attr = attrs[i];