adding legend and displayig inventory data on hover