Update _bar.py

Added legend support.