in reply to GD & GD::Graph

Okay, here is the sub that is causing the problem.

sub get_hotspot { my $self = shift; my $ds = shift; # Which data set my $np = shift; # Which data point? if (defined $np && defined $ds) { return @{$self->{_hotspots}->[$ds]->[$np]}; } elsif (defined $ds) { return @{$self->{_hotspots}->[$ds]}; } else { return @{$self->{_hotspots}}; } }
Off the top of my head, I'd say that you are pointing to a non-existant data set or point.
Make sure that you really want to put the hotspot on the second data set.
To put the hotspot on the first data set try this:
@list = $dia->get_hotspot(0,$point);
Also check to see if $point is a valid point in the chosen data set.

Replies are listed 'Best First'.
Re: Re: GD & GD::Graph
by Anonymous Monk on Nov 07, 2002 at 08:08 UTC
    hmm,
    i'll try to use the first data set.
    but the first data set isn't really a data set, it's the labels for the x-axis.

    $point is a valid point, it is validated in the script itself.

    for better understanding:
    i'm reading a list of telegramms and then create a chart to show the ammount of telegramms/sec.
    the datasets all have 1440 elements (as a day has minutes).
    for the minutes without any telegram, i insert a element with the value 0. (so after the list was read, i stretch the dataset, so that there is an element for every minute) the $point is within this range (0-1440)...

    on both systems (solaris and winnt) this problem causing sub looks alike.
    so it is not really the sub, i think. it's more likely some stupid solaris environment variable, that interferes with my perlscript...

    greetz mtm
      hmm, well, the first dataset won't work, too.
      i think i'll have to write some debugprints into the sub. I not really ever wanted to edit a pm...
        on my solaris-server, there has been a newer version of this module. but even with the older version, there occurs this error. always at the beginning of this if-block:
        if (defined $np && defined $ds) { return @{$self->{_hotspots}->[$ds]->[$np]}; } elsif (defined $ds) { return @{$self->{_hotspots}->[$ds]}; } else { return @{$self->{_hotspots}}; }

        the values of $ds and $np are correct and valid.