core: save legend