Author: spadkins
Date: Tue Feb 16 14:17:00 2010
New Revision: 13827
Modified:
p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget/ChartDirector.pm
Log:
0003514: rate category is not displayed correctly for large rate range. Also,
fixed an x-axis sorting bug
Modified: p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget/ChartDirector.pm
==============================================================================
--- p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget/ChartDirector.pm
(original)
+++ p5ee/trunk/App-Widget-ChartDirector/lib/App/Widget/ChartDirector.pm Tue Feb
16 14:17:00 2010
@@ -713,6 +713,9 @@
sub set_x_axis {
my ($self, $spec, $chart, $layer, $x) = @_;
my $x_title = $spec->{x_title} || "";
+
+ my $keys = $spec->{keys};
+
if ($x && $#$x > -1) {
my ($begin_datetime, $end_datetime, $begin_time, $end_time, $begin_yr,
$end_yr);
if ($x->[0] =~ /^[0-9]{4}-[0-9]{2}-[0-9]{2}$/) {
@@ -754,8 +757,8 @@
elsif ($x->[0] =~ /^[0-9]+$/) {
$layer->setXData($x);
}
- elsif ($x->[0] =~ /^[0-9]+-\d{3}$/) {
- # 0-100
+ elsif ($keys =~ /^rate_level_abbr/ && $x->[0] =~ /^[0-9]+-\d{2,7}$/) {
+ # e.g, 0-100, 5000-10000
$chart->xAxis()->setLabels($x);
if ($#$x >= 4 && $spec->{width} < 500) {
$chart->xAxis()->setLabels($x)->setFontAngle(45);