GDGraph

 view release on metacpan or  search on metacpan

Graph/points.pm  view on Meta::CPAN

        ($mtype == 2) && do 
        { # Square, open
            $self->{graph}->rectangle($l, $t, $r, $b, $mclr);
            last MARKER;
        };
        ($mtype == 3) && do 
        { # Cross, horizontal
            $self->{graph}->line($l, $yp, $r, $yp, $mclr);
            $self->{graph}->line($xp, $t, $xp, $b, $mclr);
            last MARKER;
        };
        ($mtype == 4) && do 
        { # Cross, diagonal
            $self->{graph}->line($l, $b, $r, $t, $mclr);
            $self->{graph}->line($l, $t, $r, $b, $mclr);
            last MARKER;
        };
        ($mtype == 5) && do 
        { # Diamond, filled
            $self->{graph}->line($l, $yp, $xp, $t, $mclr);
            $self->{graph}->line($xp, $t, $r, $yp, $mclr);
            $self->{graph}->line($r, $yp, $xp, $b, $mclr);
            $self->{graph}->line($xp, $b, $l, $yp, $mclr);
            $self->{graph}->fillToBorder($xp, $yp, $mclr, $mclr);
            last MARKER;
        };
        ($mtype == 6) && do 
        { # Diamond, open
            $self->{graph}->line($l, $yp, $xp, $t, $mclr);
            $self->{graph}->line($xp, $t, $r, $yp, $mclr);
            $self->{graph}->line($r, $yp, $xp, $b, $mclr);
            $self->{graph}->line($xp, $b, $l, $yp, $mclr);
            last MARKER;
        };
        ($mtype == 7) && do 
        { # Circle, filled
            $self->{graph}->arc($xp, $yp, 2 * $self->{marker_size},
                         2 * $self->{marker_size}, 0, 360, $mclr);
            $self->{graph}->fillToBorder($xp, $yp, $mclr, $mclr);
            last MARKER;
        };
        ($mtype == 8) && do 
        { # Circle, open
            $self->{graph}->arc($xp, $yp, 2 * $self->{marker_size},
                         2 * $self->{marker_size}, 0, 360, $mclr);
            last MARKER;
        };
        ($mtype == 9) && do
        { # Horizontal line
            $self->{graph}->line($l, $yp, $r, $yp, $mclr);
            last MARKER;
        };
        ($mtype == 10) && do
        { # vertical line
            $self->{graph}->line($xp, $t, $xp, $b, $mclr);
            last MARKER;
        };
    }
}

sub draw_legend_marker
{
    my $self = shift;
    my $n = shift;
    my $x = shift;
    my $y = shift;

    my $ci = $self->set_clr($self->pick_data_clr($n));

    my $old_ms = $self->{marker_size};
    my $ms = _min($self->{legend_marker_height}, $self->{legend_marker_width});

    ($self->{marker_size} > $ms/2) and $self->{marker_size} = $ms/2;
    
    $x += int($self->{legend_marker_width}/2);
    $y += int($self->{lg_el_height}/2);

    $n = $self->pick_marker($n);

    $self->marker($x, $y, $n, $ci);

    $self->{marker_size} = $old_ms;
}

"Just another true value";



( run in 0.873 second using v1.01-cache-2.11-cpan-e1769b4cff6 )