use Tk; use Tk::Graph; $mw = MainWindow->new; my $data = { 0 => 51, 2 => 135, -2 => 124, 4 => 5 }; my $graph = $mw->Graph(-type => 'BARS', -fill => 'both', -sortnames => 'num') ->pack(-expand => 1, -fill => 'both',); $graph->set($data); # set data MainLoop();