Apply nextgen-gallery lightbox effect [closed]

I’m not familiar with exactly how nextgen-gallery does it, but typically for lightbox effects you need to add rel="lightbox" to the image tag for it to work. To do that you’d do something like this:

$attr = array(
    'rel'   => "lightbox",
true) )),
);

echo wp_get_attachment_image( get_post_meta( get_the_ID(), 'afp_analysis_chart' , true), 'large', 0, $attr );