use Tk; use Tk::Graph; my $mw = MainWindow->new; my $data = { Sleep => 51, Work => 135, Access => 124, mySQL => 5 }; my $ca = $mw->Graph( -title => 'Example', -type => 'BARS' )->pack(qw/-expand 1 -fill both/); $ca->set($data); $mw->Button(-text => 'Change', -command => sub { $ca->configure(-type => 'Circle'); $ca->set($data); })->pack; MainLoop; #### sub setdisplay { $typ = shift; $ca->configure(-type => $typ); $ca->redraw; }