Bugfix: Legend file name needs to be unique

When there are multiple reports in a plan file they will be written to the
same directory. The legend files are unique to a report. With the old naming
scheme the legend file names would clash if there were more than one. Now
they're being created uniquely by using each report's name.