Hi,
I'm using the Tk::Graph module to include a bar-chart in my application, with data that can be updated by the app. My problem is that I'm getting an error when the key for the data is 0. For example:
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();
When I run this, I get the following error: ERROR in Tk::Graph:Tk::Graph::bar #666: No Name! at [...]/5.8.5/Tk/Graph.pm line 1802.
I tried to retrace the problem to the module's code, and found that it happens in the subroutine bar, that has the following line: my $name = shift || return error('No Name!');
As far as I understand, when the name is 0, the code goes to the error, instead of displaying the bar. Is this an expected behaviour? Am I doing something wrong?
Incidentally, are there other modules that can be used in Tk to present charts?
Thanks a lot.
In reply to Tk::Graph problem by anna_black
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |