Tk-Chart
view release on metacpan or search on metacpan
lib/Tk/Chart/Areas.pm view on Meta::CPAN
package Tk::Chart::Areas;
use warnings;
use strict;
use Carp;
#==================================================================
# $Author : Djibril Ousmanou $
# $Copyright : 2018 $
# $Update : 09/02/2018 $
# $AIM : Create area graph $
#==================================================================
use vars qw($VERSION);
$VERSION = '1.06';
use base qw/ Tk::Derived Tk::Canvas::GradientColor /;
use Tk::Balloon;
use Tk::Chart::Utils qw / :DUMMIES :DISPLAY /;
use Tk::Chart qw / :DUMMIES /;
Construct Tk::Widget 'Areas';
my $POINT = q{.};
sub Populate {
my ( $cw, $ref_parameters ) = @_;
# Get initial parameters
$cw->{RefChart} = _initconfig();
$cw->SUPER::Populate($ref_parameters);
$cw->Advertise( 'GradientColor' => $cw );
$cw->Advertise( 'canvas' => $cw->SUPER::Canvas );
$cw->Advertise( 'Canvas' => $cw->SUPER::Canvas );
# remove highlightthickness if necessary
if ( !exists $ref_parameters->{-highlightthickness} ) {
$cw->configure( -highlightthickness => 0 );
}
my $ref_configcommon = _get_configspecs();
# ConfigSpecs
$cw->ConfigSpecs(
# Common options
%{$ref_configcommon},
-viewsection => [ 'PASSIVE', 'Viewsection', 'ViewSection', 1 ],
-outlinearea => [ 'PASSIVE', 'Outlinearea', 'OutlineArea', 'black' ],
);
$cw->Delegates( DEFAULT => $cw, );
# recreate graph after widget resize
$cw->enabled_automatic_redraw();
$cw->disabled_gradientcolor();
return;
}
sub _balloon {
my ($cw) = @_;
# balloon defined and user want to stop it
if ( defined $cw->{RefChart}->{Balloon}{Obj}
and $cw->{RefChart}->{Balloon}{State} == 0 )
{
$cw->_destroyballoon_bind();
return;
}
# balloon not defined and user want to stop it
( run in 1.075 second using v1.01-cache-2.11-cpan-a1f116cd669 )