auto generate legend using version
add control to switch legend
legend can be switched off