graph is fully functioning with legend