Return min and max value even if you have NaN, using bottleneck if available
Add a BarWidget
Remove duplicate code, manage vertical and horizontal bar in the same way