The reason why it won't display the legend (or the filter) is because of the templating engine...
When something is using the template, the variables are "segregated" from the rest of the code. So, if you look at the code for both the legend and the filter, it says if you don't find the categories described, exit. Since the categories have either not been defined yet, or that they have but are not accessible to the template, nothing is displayed.
That's why I asked you to add the require("../config.inc.php"); in the legend.php - it's what defines the categories.
EPC Tutorials... We're here to help!
Offering custom integration services. Contact me here
* Not affiliated with EasyPHPCalendar or NashTech Inc.