added legend and remove no data fix #20, fix #21, fix #28