It looks like this isn't a
GD::Graph issue but rather a referencing issue. Specifically, the way you're assigning your arrays is wrong. It should be either:
@name1 = (6, 18, 21, 28, 36, 44, 52, 67, 78, 89);
@name2 = (1, 15, 22, 31, 45, 7, 19, 21, 36, 41);
@name3 = (8, 91, 78, 88, 87, 80, 96, 95, 99, 99);
@xaxis = (1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
or else
$name1 = [6, 18, 21, 28, 36, 44, 52, 67, 78, 89];
$name2 = [1, 15, 22, 31, 45, 7, 19, 21, 36, 41];
$name3 = [8, 91, 78, 88, 87, 80, 96, 95, 99, 99];
$xaxis = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
In the latter case, you would change the @data assignment to
@data = (
$xaxis,
$name1,
$name2,
$name3
);
The reason is that with your current code, you're actually creating three one-element arrays, each containing an array reference as its first element. Also, if you do go with the first approach, no need to duplicate the contents of the arrays. Just do
@data = (
\@xaxis,
\@name1,
\@name2,
\@name3
);