Not really knowing what your map looks like, or what other settings are in effect when you run it (eg, what font sizes, or how long the legend text is, etc), I'll just try to give some advice that will get you past the warnings, and at least show a legend (maybe not quite the legend you want ... but at least a starting point).
Perhaps the legend text values are too long to fit in the graph area, or perhaps the text is in a large font which makes it extend outside the graph area. Or, perhaps the legend origin position is causing a problem.
Perhaps if you try something like this instead of the legend statement you're currently using, it will create a legend with very small text font, that will fit in the graph area and not trigger the warning that suppresses the legend (I'm writing these options from memory - they might need some fine-tuning!) ...
goptions htext=5pt;
legend1 position=(top left) across=1 mode=share;
... View more