legend and icon dynamic creation