Added support for disabling legend.