Chart

 view release on metacpan or  search on metacpan

lib/Chart/LinesPoints.pm  view on Meta::CPAN

                # remember the imagemap data if they wanted it
                if ( $self->true( $self->{'imagemap'} ) )
                {
                    $self->{'imagemap_data'}->[$i][$j] = [ $x2, $y2 ];
                }
            }
            else
            {
                if ( $self->true( $self->{'imagemap'} ) )
                {
                    $self->{'imagemap_data'}->[$i][$j] = [ undef(), undef() ];
                }
            }
        }
    }

    # and finaly box it off
    $self->{'gd_obj'}
      ->rectangle( $self->{'curr_x_min'}, $self->{'curr_y_min'}, $self->{'curr_x_max'}, $self->{'curr_y_max'}, $misccolor );

    #get the width and the heigth of the complete picture
    ( $abs_x_max, $abs_y_max ) = $self->{'gd_obj'}->getBounds();

    #repair the chart, if the lines are out of the borders of the chart
    if ($repair_top_flag)
    {

        #overwrite the ugly mistakes
        #   $self->{'gd_obj'}->filledRectangle ($self->{'curr_x_min'}, 0,
        $self->{'gd_obj'}->filledRectangle(
            $self->{'curr_x_min'} - ( $self->{'brush_size'} / 2 ),
            0, $self->{'curr_x_max'},
            $self->{'curr_y_min'} - 2,
            $self->_color_role_to_index('background')
        );

        #save the actual x and y values
        $t_x_min = $self->{'curr_x_min'};
        $t_x_max = $self->{'curr_x_max'};
        $t_y_min = $self->{'curr_y_min'};
        $t_y_max = $self->{'curr_y_max'};

        #get back to the point, where everything began
        $self->{'curr_x_min'} = 0;
        $self->{'curr_y_min'} = 0;
        $self->{'curr_x_max'} = $abs_x_max;
        $self->{'curr_y_max'} = $abs_y_max;

        #draw the title again
        if ( $self->{'title'} )
        {
            $self->_draw_title;
        }

        #draw the sub title again
        if ( $self->{'sub_title'} )
        {
            $self->_draw_sub_title;
        }

        #draw the top legend again
        if ( $self->{'legend'} =~ /^top$/i )
        {
            $self->_draw_top_legend;
        }

        #reset the actual values
        $self->{'curr_x_min'} = $t_x_min;
        $self->{'curr_x_max'} = $t_x_max;
        $self->{'curr_y_min'} = $t_y_min;
        $self->{'curr_y_max'} = $t_y_max;
    }

    if ($repair_bottom_flag)
    {

        #overwrite the ugly mistakes
        # $self->{'gd_obj'}->filledRectangle ($self->{'curr_x_min'}, $self->{'curr_y_max'}+1,
        $self->{'gd_obj'}->filledRectangle(
            $self->{'curr_x_min'} - ( $self->{'brush_size'} / 2 ),
            $self->{'curr_y_max'} + 1,
            $self->{'curr_x_max'}, $abs_y_max, $self->_color_role_to_index('background')
        );

        #save the actual x and y values
        $t_x_min = $self->{'curr_x_min'};
        $t_x_max = $self->{'curr_x_max'};
        $t_y_min = $self->{'curr_y_min'};
        $t_y_max = $self->{'curr_y_max'};

        #get back to the point, where everything began
        $self->{'curr_x_min'} = 0;
        $self->{'curr_y_min'} = 0;
        $self->{'curr_x_max'} = $abs_x_max;
        $self->{'curr_y_max'} = $abs_y_max - 1;

        # mark off the graph_border space
        $self->{'curr_y_max'} -= 2 * $self->{'graph_border'};

        #draw the bottom legend again
        if ( $self->{'legend'} =~ /^bottom$/i )
        {
            $self->_draw_bottom_legend;
        }

        #draw the x label again
        if ( $self->{'x_label'} )
        {
            $self->_draw_x_label;
        }

        #get back to the start point for the ticks
        $self->{'curr_x_min'} = $self->{'temp_x_min'};
        $self->{'curr_y_min'} = $self->{'temp_y_min'};
        $self->{'curr_x_max'} = $self->{'temp_x_max'};
        $self->{'curr_y_max'} = $self->{'temp_y_max'};

        #draw the x ticks again
        $self->_draw_x_ticks;

        #reset the actual values
        $self->{'curr_x_min'} = $t_x_min;
        $self->{'curr_x_max'} = $t_x_max;
        $self->{'curr_y_min'} = $t_y_min;
        $self->{'curr_y_max'} = $t_y_max;
    }

    return;

}

## be a good module and return 1
1;



( run in 3.472 seconds using v1.01-cache-2.11-cpan-5837b0d9d2c )