Two things:
1) You need to watch your paths! You’re including a file of "assets/snippets/Graph/graph.php" -- but that targets a different file depending on where the script is executed. I’d recommend using the ’base_path’ variable:
include_once($modx->config['base_path'].'assets/snippets/Graph/graph.php');
This works so long as you have your base path set correctly in the manager Config.
2) What do you mean by "style"? Do you mean how do you alter the text used in your chart image? That’s a good question. It looks like your web server may be missing some fonts -- that may explain the weird characters that you’re seeing. Are you sure you have the GD and FreeType libraries installed?
What you might want to do in your page is something like this:
<img src="/assets/snippets/Graph/dynamic_image_generator.php?param=value" />
And then in the
dynamic_image_generator.php page, print out your image. This approach will ensure that the browser interprets the script output as an image and not as text. It’s all about sending the correct headers.