$p->{$name}->{showvalues} = $p->{$name}->{showvalues} || 0;
$p->{$name}->{storable} = $p->{$name}->{storable} || 0;
$p->{$name}->{plot_string} = ""; # to store the plot command
+ $p->{$name}{additional} = $p->{$name}{additional} || '';
my $filename = $p->{$name}->{file};
$filename =~ s%/%%;
plot_write($fh,"set autoscale fix");
plot_write($fh,"set xtics autofreq"); #$p->{$name}->{entries}
plot_write($fh,"set grid");
+ plot_write($fh,$p->{$name}{additional}) if $p->{$name}{additional};
# plot_write($fh,"set style fill solid 1.0");
#plot_write($fh,"plot ",1);
$p->{$name}->{plot_string} .= "plot ";
plot_write($fh, $p->{$name}->{plot_string});
}
elsif ($p->{$name}->{type} == TYPE_BARGRAPH) {
+ my $stacked = $p->{$name}{stacked}?' rowstacked':'';
plot_write($fh,"set style fill solid 1.00 border -1");
plot_write($fh,"set grid noxtics ytics");
plot_write($fh,"set boxwidth ".($p->{$name}->{curvewidth}||4)." absolute");
- plot_write($fh,"set style histogram gap ".($p->{$name}->{bargap}||1));
+ plot_write($fh,"set style histogram gap ".($p->{$name}->{bargap}||1).' '.$stacked);
if (defined $p->{$name}->{bartitle} && scalar @{$p->{$name}->{bartitle}}) {
plot_write($fh,"set xtics (",1);
for (my $j=0; $j<scalar @{$p->{$name}->{bartitle}};$j++) {
}
plot_write($fh,"set style histogram title offset character 0, 0, 0");
plot_write($fh,"set style data histograms");
+ plot_write($fh,$p->{$name}{additional});
#plot_write($fh,"plot ",1);
$p->{$name}->{plot_string} .= "plot ";
for (my $j=0; $j<$p->{$name}->{curves};$j++) {
}
if($p->{$name}->{type} == TYPE_HISTORY) {
+ my $realentries = $p->{$name}{limitentries} || $p->{$name}->{entries};
for(my $j=0; $j<$p->{$name}->{curves}; $j++) {
- for(my $i=0; $i< $p->{$name}->{entries}; $i++) {
+ for(my $i=$p->{$name}->{entries}-$realentries; $i< $p->{$name}->{entries}; $i++) {
if ($p->{$name}->{countup}) {
- plot_write($p->{$name}->{fh},($i/$p->{$name}->{xscale})." ".$p->{$name}->{value}->[$j]->[$i]);
+ plot_write($p->{$name}->{fh},(($i-($p->{$name}->{entries}-$realentries))/$p->{$name}->{xscale})." ".$p->{$name}->{value}->[$j]->[$i]);
}
else {
- plot_write($p->{$name}->{fh},(($i-$p->{$name}->{entries})/($p->{$name}->{xscale}||1))." ".($p->{$name}->{value}->[$j]->[$i]||0));
+ plot_write($p->{$name}->{fh},(($i-$realentries)/($p->{$name}->{xscale}||1))." ".($p->{$name}->{value}->[$j]->[$i]||0));
}
}
plot_write($p->{$name}->{fh},"e");
}
if($p->{$name}->{type} == TYPE_BARGRAPH) {
+ my $realentries = $p->{$name}{limitentries} || $p->{$name}->{entries};
#plot_write($p->{$name}->{fh}, $p->{$name}->{plot_string});
for(my $j=0; $j<$p->{$name}->{curves}; $j++) {
- for(my $i=0; $i< $p->{$name}->{entries}; $i++) {
+ for(my $i=$p->{$name}->{entries}-$realentries; $i< $p->{$name}->{entries}; $i++) {
plot_write($p->{$name}->{fh},' '.$p->{$name}->{value}->[$j]->[$i]);
}
plot_write($p->{$name}->{fh},"e");
$p->{$name}->{value}->[$curve]->[$slot] = $value||0;
}
+sub PlotLimitEntries {
+ my ($name,$entries) = @_;
+ $p->{$name}{limitentries} = $entries;
+ }
1;