SVG-TT-Graph

 view release on metacpan or  search on metacpan

lib/SVG/TT/Graph/TimeSeries.pm  view on Meta::CPAN

  return $dt->epoch();
}

# override calculations to set a few calculated values, mainly for scaling
sub calculations {
  my $self = shift;

  # Need to set the timezone in order for x-axis labels to be 
  # formatted correctly by strftime:
  $ENV{'TZ'} = $self->{config}->{timescale_time_zone};
  POSIX::tzset() if ($] lt '5.008009');

  # run through the data and calculate maximum and minimum values
  my ($max_key_size,$max_time,$min_time,$max_value,$min_value,$max_x_label_length,$x_label);

  foreach my $dataset (@{$self->{data}}) {
    $max_key_size = length($dataset->{title}) if ((!defined $max_key_size) || ($max_key_size < length($dataset->{title})));

    foreach my $pair (@{$dataset->{pairs}}) {
      $max_time = $pair->[0] if ((!defined $max_time) || ($max_time < $pair->[0]));
      $min_time = $pair->[0] if ((!defined $min_time) || ($min_time > $pair->[0]));



( run in 0.890 second using v1.01-cache-2.11-cpan-cc502c75498 )