| 1 | # ----------------------------------------------------------------------------- | ||
| 2 | |||
| 3 | =encoding utf8 | ||
| 4 | |||
| 5 | =head1 NAME | ||
| 6 | |||
| 7 | Quiq::Gd::Component::Graph - Polyline-Graph | ||
| 8 | |||
| 9 | =head1 BASE CLASS | ||
| 10 | |||
| 11 | L<Quiq::Gd::Component> | ||
| 12 | |||
| 13 | =head1 DESCRIPTION | ||
| 14 | |||
| 15 | Das Objekt repräsentiert einen Graph entlang der Weltkoordinaten @x und @y. | ||
| 16 | Per Default wird der Graph über der gesamten Fläche des Bildes gezeichnet. | ||
| 17 | Durch die Angabe C<< colors=>\@colors >> kann als dritte Dimension ein Farbwert | ||
| 18 | entlang des Graphen gezeichnet werden. Punkte und Linien werden in diesen | ||
| 19 | Farben gezeichnet, sofern per (C<pointColor>) oder (C<lineColor>) nichts | ||
| 20 | anderes vorgegeben ist. | ||
| 21 | |||
| 22 | =head1 ATTRIBUTES | ||
| 23 | |||
| 24 | Fett hervorgehobene Attribute sind Pflichtangaben beim Konstruktor-Aufruf. | ||
| 25 | |||
| 26 | =over 4 | ||
| 27 | |||
| 28 | =item B<< width => $int >> (Default: keiner) | ||
| 29 | |||
| 30 | Breite der Grafik in Pixeln. | ||
| 31 | |||
| 32 | =item B<< height => $int >> (Default: keiner) | ||
| 33 | |||
| 34 | Höhe der Grafik in Pixeln. | ||
| 35 | |||
| 36 | =item x => \@x (Default: []) | ||
| 37 | |||
| 38 | Array der X-Werte (Weltkoordinate). | ||
| 39 | |||
| 40 | =item y => \@y (Default: []) | ||
| 41 | |||
| 42 | Array der Y-Werte (Weltkoordinate). | ||
| 43 | |||
| 44 | =item colors => \@colors (Default: undef) | ||
| 45 | |||
| 46 | Farben der Datenpunkte und Linien. Jeder Datenpunkt und jede | ||
| 47 | Verbindungslinie hat eine eigene Farbe. Siehe Beispiel | ||
| 48 | L<Graph mit verschiedenfarbigen Datenpunkten und Linien|"Graph mit verschiedenfarbigen Datenpunkten und Linien">. | ||
| 49 | |||
| 50 | =item lineColor => $color (Default: Defaultfarbe) | ||
| 51 | |||
| 52 | Farbe der Verbindungslinien. FIMXE: Verhältnis zu Attribut colors | ||
| 53 | beschreiben. | ||
| 54 | |||
| 55 | =item lineThickness => $n (Default: 1) | ||
| 56 | |||
| 57 | Dicke der Verbindungsline in Pixeln. Wenn 0, wird keine Linie gezeichnet. | ||
| 58 | |||
| 59 | =item xMin => $f (Default: Minimum der X-Werte) | ||
| 60 | |||
| 61 | Anfang des X-Wertebereichs (Weltkoodinate). | ||
| 62 | |||
| 63 | =item xMax => $f (Default: Maximum der X-Werte) | ||
| 64 | |||
| 65 | Ende des X-Wertebereichs (Weltkoodinate). | ||
| 66 | |||
| 67 | =item yMin => $f (Default: Minimum der Y-Werte) | ||
| 68 | |||
| 69 | Anfang des Y-Wertebereichs (Weltkoodinate). | ||
| 70 | |||
| 71 | =item yMax => $f (Default: Maximum der Y-Werte) | ||
| 72 | |||
| 73 | Ende des Y-Wertebereichs (Weltkoodinate). | ||
| 74 | |||
| 75 | =item xMaxDelta => $f (Default: undef) | ||
| 76 | |||
| 77 | Maximaler Abstand zwischen zwei benachbarten Punkten in X-Richtung. | ||
| 78 | Wird dieser Abstand überschritten, werden die Punkte nicht | ||
| 79 | durch eine Linie verbunden. | ||
| 80 | |||
| 81 | =item yMaxDelta => $f (Default: undef) | ||
| 82 | |||
| 83 | Wie C<xMaxDelta>, nur in Y-Richtung. | ||
| 84 | |||
| 85 | =item pointColor => $color (Default: Defaultfarbe) | ||
| 86 | |||
| 87 | Farbe, in der alle Datenpunkte gezeichnet werden. | ||
| 88 | |||
| 89 | =item pointSize => $n (Default: 1) | ||
| 90 | |||
| 91 | Größe des Punktes in Pixeln. Der Punkt wird gemäß C<pointStyle> | ||
| 92 | dargestellt. Der Wert sollte ungerade sein: 1, 3, 5, usw., damit | ||
| 93 | die Darstellung mittig über dem Datenpunkt stattfindet. | ||
| 94 | |||
| 95 | =item pointStyle => $style (Default: 'square') | ||
| 96 | |||
| 97 | Darstellung des Punktes: 'square', 'circle'. | ||
| 98 | |||
| 99 | =item adaptPlotRegion => $bool (Default: 0) | ||
| 100 | |||
| 101 | Ist die Punktgröße > 1 (s. Attribut C<pointSize>), erweitere den | ||
| 102 | Plotbereich (Attribute C<xMin>, C<xMax>, C<yMin>, C<yMax>) derart, | ||
| 103 | dass die Datenpunkte auch am Rand vollständig gezeichnet werden. | ||
| 104 | |||
| 105 | =back | ||
| 106 | |||
| 107 | =head1 EXAMPLES | ||
| 108 | |||
| 109 | =head2 Einfacher Graph | ||
| 110 | |||
| 111 | Code: | ||
| 112 | |||
| 113 | require Quiq::Gd::Image; | ||
| 114 | require Quiq::Gd::Component::Graph; | ||
| 115 | |||
| 116 | my ($width,$height) = (500,100); | ||
| 117 | |||
| 118 | $img = Quiq::Gd::Image->new($width,$height); | ||
| 119 | $img->background('#ffffff'); | ||
| 120 | my $g = Quiq::Gd::Component::Graph->new( | ||
| 121 | width=>$width, | ||
| 122 | height=>$height, | ||
| 123 | x=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
| 124 | y=>[0, 9, 7.5, 1, 1.9, 6, 4, 6.3, 0.5, 10], | ||
| 125 | ); | ||
| 126 | $g->render($img); | ||
| 127 | |||
| 128 | Im Browser: | ||
| 129 | |||
| 130 | [Nur im Browser sichtbar] | ||
| 131 | |||
| 132 | =head2 Graph mit gekennzeichneten Datenpunkten | ||
| 133 | |||
| 134 | Code: | ||
| 135 | |||
| 136 | require Quiq::Gd::Image; | ||
| 137 | require Quiq::Gd::Component::Graph; | ||
| 138 | |||
| 139 | my ($width,$height) = (500,100); | ||
| 140 | |||
| 141 | $img = Quiq::Gd::Image->new($width,$height); | ||
| 142 | $img->background('#ffffff'); | ||
| 143 | $img->border('#d0d0d0'); | ||
| 144 | |||
| 145 | my $g = Quiq::Gd::Component::Graph->new( | ||
| 146 | width=>$width, | ||
| 147 | height=>$height, | ||
| 148 | x=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
| 149 | y=>[0, 9, 7.5, 1, 1.9, 6, 4, 6.3, 0.5, 10], | ||
| 150 | pointColor=>'#ff0000', | ||
| 151 | pointSize=>5, | ||
| 152 | ); | ||
| 153 | $g->render($img); | ||
| 154 | |||
| 155 | Im Browser: | ||
| 156 | |||
| 157 | [Nur im Browser sichtbar] | ||
| 158 | |||
| 159 | Wir setzen die Punktfarbe und die Punktgröße. Die Endpunkte sind | ||
| 160 | abgeschnitten, da ein Teil von ihnen außerhalb des Bildes liegt. | ||
| 161 | |||
| 162 | =head2 Graph mit verschiedenfarbigen Datenpunkten und Linien | ||
| 163 | |||
| 164 | Code: | ||
| 165 | |||
| 166 | require Quiq::Gd::Image; | ||
| 167 | require Quiq::Gd::Component::Graph; | ||
| 168 | |||
| 169 | my ($width,$height) = (504,104); | ||
| 170 | |||
| 171 | $img = Quiq::Gd::Image->new($width,$height); | ||
| 172 | $img->background('#ffffff'); | ||
| 173 | $img->border('#d0d0d0'); | ||
| 174 | |||
| 175 | my $g = Quiq::Gd::Component::Graph->new( | ||
| 176 | width=>$width-4, | ||
| 177 | height=>$height-4, | ||
| 178 | x=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
| 179 | y=>[0, 9, 7.5, 1, 1.9, 6, 4, 6.3, 0.5, 10], | ||
| 180 | colors=>[ | ||
| 181 | '#ff0000', | ||
| 182 | '#00ff00', | ||
| 183 | '#0000ff', | ||
| 184 | '#ffff00', | ||
| 185 | '#ff00ff', | ||
| 186 | '#00ffff', | ||
| 187 | '#000000', | ||
| 188 | '#808000', | ||
| 189 | '#800080', | ||
| 190 | '#008080', | ||
| 191 | ], | ||
| 192 | pointSize=>5, | ||
| 193 | ); | ||
| 194 | $g->render($img,2,2); | ||
| 195 | |||
| 196 | Im Browser: | ||
| 197 | |||
| 198 | [Nur im Browser sichtbar] | ||
| 199 | |||
| 200 | Wenn Eigenschaft C<colors> definiert ist, werden die Punkte und | ||
| 201 | Verbindungslinien in den angegebenen Farben dargestellt. | ||
| 202 | Die Linie hat die Farbe des Anfangspunktes, der letzte Punkt | ||
| 203 | hat keine Verbindungsline. Mit C<pointColor> oder C<lineColor> | ||
| 204 | kann die Punkt- oder Linienfarbe auf eine bestimmte Farbe | ||
| 205 | festgelegt werden (beide im Falle von C<colors> fix | ||
| 206 | einzustellen, macht wenig Sinn, denn dann hat C<colors> keinen | ||
| 207 | Effekt mehr). Die Endpunkte sind hier im Gegensatz zum | ||
| 208 | vorigen Beispiel vollständig dargestellt, da wir das Bild um 4 Pixel | ||
| 209 | breiter und höher gemacht haben als den Plotbereich. | ||
| 210 | |||
| 211 | =head2 Größe Plotregion anpassen mit adaptPlotRegion | ||
| 212 | |||
| 213 | Code: | ||
| 214 | |||
| 215 | require Quiq::Gd::Image; | ||
| 216 | require Quiq::Gd::Component::Graph; | ||
| 217 | |||
| 218 | my ($width,$height) = (504,104); | ||
| 219 | |||
| 220 | $img = Quiq::Gd::Image->new($width,$height); | ||
| 221 | $img->background('#ffffff'); | ||
| 222 | $img->border('#d0d0d0'); | ||
| 223 | |||
| 224 | my $g = Quiq::Gd::Component::Graph->new( | ||
| 225 | width=>$width, | ||
| 226 | height=>$height, | ||
| 227 | pointSize=>5, | ||
| 228 | adaptPlotRegion=>1, | ||
| 229 | x=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], | ||
| 230 | y=>[0, 9, 7.5, 1, 1.9, 6, 4, 6.3, 0.5, 10], | ||
| 231 | colors=>[ | ||
| 232 | '#ff0000', | ||
| 233 | '#00ff00', | ||
| 234 | '#0000ff', | ||
| 235 | '#ffff00', | ||
| 236 | '#ff00ff', | ||
| 237 | '#00ffff', | ||
| 238 | '#000000', | ||
| 239 | '#808000', | ||
| 240 | '#800080', | ||
| 241 | '#008080', | ||
| 242 | ], | ||
| 243 | ); | ||
| 244 | $g->render($img); | ||
| 245 | |||
| 246 | Im Browser: | ||
| 247 | |||
| 248 | [Nur im Browser sichtbar] | ||
| 249 | |||
| 250 | Mit C<adaptPlotRegion> wird der Plotbereich so verkleinert, dass | ||
| 251 | Punkte am Rand vollständig sichtbar sind. | ||
| 252 | |||
| 253 | =cut | ||
| 254 | |||
| 255 | # ----------------------------------------------------------------------------- | ||
| 256 | |||
| 257 | package Quiq::Gd::Component::Graph; | ||
| 258 | use base qw/Quiq::Gd::Component/; | ||
| 259 | |||
| 260 | use v5.10; | ||
| 261 | use strict; | ||
| 262 | use warnings; | ||
| 263 | |||
| 264 | our $VERSION = '1.240'; | ||
| 265 | |||
| 266 | use Quiq::Array; | ||
| 267 | use Quiq::Math; | ||
| 268 | |||
| 269 | # ----------------------------------------------------------------------------- | ||
| 270 | |||
| 271 | =head1 METHODS | ||
| 272 | |||
| 273 | =head2 Konstruktor | ||
| 274 | |||
| 275 | =head3 new() - Konstruktor | ||
| 276 | |||
| 277 | =head4 Synopsis | ||
| 278 | |||
| 279 | $g = $class->new(@keyVal); | ||
| 280 | |||
| 281 | =head4 Description | ||
| 282 | |||
| 283 | Instantiiere ein Grafik-Objekt mit den Eigenschaften @keyVal | ||
| 284 | (s. Abschnitt L<ATTRIBUTES|"ATTRIBUTES">) und liefere eine Referenz auf das Objekt | ||
| 285 | zurück. | ||
| 286 | |||
| 287 | =cut | ||
| 288 | |||
| 289 | # ----------------------------------------------------------------------------- | ||
| 290 | |||
| 291 | sub new { | ||
| 292 | my $class = shift; | ||
| 293 | # @_: @keyVal | ||
| 294 | |||
| 295 | my $self = $class->SUPER::new( | ||
| 296 | width => undef, | ||
| 297 | height => undef, | ||
| 298 | x => [], | ||
| 299 | y => [], | ||
| 300 | colors => undef, | ||
| 301 | lineColor => undef, | ||
| 302 | lineThickness => 1, | ||
| 303 | xMin => undef, | ||
| 304 | xMax => undef, | ||
| 305 | yMin => undef, | ||
| 306 | yMax => undef, | ||
| 307 | xMaxDelta => undef, | ||
| 308 | yMaxDelta => undef, | ||
| 309 | pointColor => undef, | ||
| 310 | pointSize => 1, | ||
| 311 | pointStyle => 'square', | ||
| 312 | adaptPlotRegion => 0, | ||
| 313 | ); | ||
| 314 | $self->set(@_); | ||
| 315 | |||
| 316 | # Pflicht-Attribute prüfen | ||
| 317 | |||
| 318 | for my $key (qw/width height/) { | ||
| 319 | if (!defined $self->{$key}) { | ||
| 320 | $self->throw( | ||
| 321 | 'GRAPHIC-00001: Pflicht-Attribut ist nicht gesetzt', | ||
| 322 | Attribute => $key, | ||
| 323 | ); | ||
| 324 | } | ||
| 325 | } | ||
| 326 | |||
| 327 | # Defaultwerte berechnen, die wir im Konstruktor berechnen müssen, | ||
| 328 | # damit die Objektmethoden (xMin(), ...) korrekte Wert liefern. | ||
| 329 | |||
| 330 | my $xMin = $self->{'xMin'}; | ||
| 331 | my $xMax = $self->{'xMax'}; | ||
| 332 | my $yMin = $self->{'yMin'}; | ||
| 333 | my $yMax = $self->{'yMax'}; | ||
| 334 | |||
| 335 | if (!defined $xMin) { | ||
| 336 | $xMin = Quiq::Array->min($self->{'x'}) // 0; | ||
| 337 | } | ||
| 338 | if (!defined $xMax) { | ||
| 339 | $xMax = Quiq::Array->max($self->{'x'}) // 0; | ||
| 340 | } | ||
| 341 | if (!defined $yMin) { | ||
| 342 | $yMin = Quiq::Array->min($self->{'y'}) // 0; | ||
| 343 | } | ||
| 344 | if (!defined $yMax) { | ||
| 345 | $yMax = Quiq::Array->max($self->{'y'}) // 0; | ||
| 346 | } | ||
| 347 | if ($xMin == $xMax) { | ||
| 348 | $xMin -= 1; | ||
| 349 | $xMax += 1; | ||
| 350 | } | ||
| 351 | if ($yMin == $yMax) { | ||
| 352 | $yMin -= 1; | ||
| 353 | $yMax += 1; | ||
| 354 | } | ||
| 355 | |||
| 356 | my $pointSize = $self->{'pointSize'}; | ||
| 357 | if ($pointSize > 1 && $self->{'adaptPlotRegion'}) { | ||
| 358 | # Wertebereich in X- und Y-Richtung erweitern, so dass | ||
| 359 | # Platz für die vollständige Darstellung der Punkte ist | ||
| 360 | |||
| 361 | my $pixel = int($pointSize/2); # zusätzliche Pixel pro Seite | ||
| 362 | |||
| 363 | my $valPerPixelX = ($xMax-$xMin)/($self->{'width'}-2*$pixel); | ||
| 364 | $xMin -= $pixel*$valPerPixelX; | ||
| 365 | $xMax += $pixel*$valPerPixelX; | ||
| 366 | |||
| 367 | my $valPerPixelY = ($yMax-$yMin)/($self->{'height'}-2*$pixel); | ||
| 368 | $yMin -= $pixel*$valPerPixelY; | ||
| 369 | $yMax += $pixel*$valPerPixelY; | ||
| 370 | } | ||
| 371 | |||
| 372 | $self->{'xMin'} = $xMin; | ||
| 373 | $self->{'xMax'} = $xMax; | ||
| 374 | $self->{'yMin'} = $yMin; | ||
| 375 | $self->{'yMax'} = $yMax; | ||
| 376 | |||
| 377 | return $self; | ||
| 378 | } | ||
| 379 | |||
| 380 | # ----------------------------------------------------------------------------- | ||
| 381 | |||
| 382 | =head2 Zeichnen | ||
| 383 | |||
| 384 | =head3 render() - Zeichne Grafik | ||
| 385 | |||
| 386 | =head4 Synopsis | ||
| 387 | |||
| 388 | $g->render($img); | ||
| 389 | $g->render($img,$x,$y,@keyVal); | ||
| 390 | $class->render($img,$x,$y,@keyVal); | ||
| 391 | |||
| 392 | =head4 Description | ||
| 393 | |||
| 394 | Zeichne die Grafik in Bild $img an Position ($x,$y). | ||
| 395 | Die Methode liefert keinen Wert zurück. | ||
| 396 | |||
| 397 | =cut | ||
| 398 | |||
| 399 | # ----------------------------------------------------------------------------- | ||
| 400 | |||
| 401 | sub render { | ||
| 402 | my $this = shift; | ||
| 403 | my $img = shift; | ||
| 404 | my $x = shift || 0; | ||
| 405 | my $y = shift || 0; | ||
| 406 | # @_: @keyVal | ||
| 407 | |||
| 408 | my $self = $this->self(@_); | ||
| 409 | |||
| 410 | # Attribute | ||
| 411 | |||
| 412 | my $width = $self->{'width'}; | ||
| 413 | my $height = $self->{'height'}; | ||
| 414 | my $xA = $self->{'x'}; | ||
| 415 | my $yA = $self->{'y'}; | ||
| 416 | my $colorA = $self->{'colors'}; | ||
| 417 | my $lineColor = $self->{'lineColor'}; | ||
| 418 | my $lineThickness = $self->{'lineThickness'}; | ||
| 419 | my $xMin = $self->{'xMin'}; | ||
| 420 | my $xMax = $self->{'xMax'}; | ||
| 421 | my $yMin = $self->{'yMin'}; | ||
| 422 | my $yMax = $self->{'yMax'}; | ||
| 423 | my $xMaxDelta = $self->{'xMaxDelta'}; | ||
| 424 | my $yMaxDelta = $self->{'yMaxDelta'}; | ||
| 425 | my $pointColor = $self->{'pointColor'}; | ||
| 426 | my $pointSize = $self->{'pointSize'}; | ||
| 427 | my $pointStyle = $self->{'pointStyle'}; | ||
| 428 | |||
| 429 | # Zeichnen | ||
| 430 | |||
| 431 | if (@$xA == 0) { | ||
| 432 | # Keine Daten, nichts tun | ||
| 433 | return; | ||
| 434 | } | ||
| 435 | |||
| 436 | # Farben | ||
| 437 | |||
| 438 | if (defined $lineColor || !$colorA) { | ||
| 439 | $lineColor = $img->color($lineColor); | ||
| 440 | } | ||
| 441 | if (defined $pointColor || !$colorA) { | ||
| 442 | $pointColor = $img->color($pointColor); | ||
| 443 | } | ||
| 444 | |||
| 445 | # Weltkoordinaten in Pixelkoordinaten umrechnen | ||
| 446 | |||
| 447 | my (@x,@y,@c); | ||
| 448 | for (my $i = 0; $i < @$xA; $i++) { | ||
| 449 | push @x,$x+Quiq::Math->valueToPixelX($width,$xMin,$xMax, | ||
| 450 | $xA->[$i]); | ||
| 451 | push @y,$y+Quiq::Math->valueToPixelY($height,$yMin,$yMax, | ||
| 452 | $yA->[$i]); | ||
| 453 | if ($colorA) { | ||
| 454 | push @c,$img->color($colorA->[$i]); | ||
| 455 | } | ||
| 456 | } | ||
| 457 | |||
| 458 | # Einen einzelnen Punkt zeichnen wir als Kreuz | ||
| 459 | |||
| 460 | if (@$xA == 1) { | ||
| 461 | my $color = defined $lineColor? $lineColor: $c[0]; | ||
| 462 | $img->drawCross($x[0],$y[0],$color); | ||
| 463 | return; | ||
| 464 | } | ||
| 465 | |||
| 466 | # Verbindungslinien zeichnen | ||
| 467 | |||
| 468 | if ($lineThickness) { | ||
| 469 | $img->setThickness($lineThickness); | ||
| 470 | for (my $i = 0; $i < @x-1; $i++) { | ||
| 471 | # Prüfe, ob Punkte zu weit auseinander liegen | ||
| 472 | |||
| 473 | if (defined $xMaxDelta && | ||
| 474 | $xA->[$i+1]-$xA->[$i] > $xMaxDelta) { | ||
| 475 | next; | ||
| 476 | } | ||
| 477 | if (defined $yMaxDelta && | ||
| 478 | abs($yA->[$i+1]-$yA->[$i]) > $yMaxDelta) { | ||
| 479 | next; | ||
| 480 | } | ||
| 481 | |||
| 482 | # Zeichne Linie | ||
| 483 | |||
| 484 | my $color = defined $lineColor? $lineColor: $c[$i]; | ||
| 485 | $img->line($x[$i],$y[$i],$x[$i+1],$y[$i+1],$color); | ||
| 486 | } | ||
| 487 | } | ||
| 488 | |||
| 489 | # Punkte zeichnen | ||
| 490 | |||
| 491 | if (!$lineThickness || $pointSize > $lineThickness || | ||
| 492 | $pointColor != $lineColor || $colorA) { | ||
| 493 | $img->setThickness(1); | ||
| 494 | for (my $i = 0; $i < @x; $i++) { | ||
| 495 | my $color = defined $pointColor? $pointColor: $c[$i]; | ||
| 496 | |||
| 497 | if ($pointSize == 1) { | ||
| 498 | $img->setPixel($x[$i],$y[$i],$color); | ||
| 499 | } | ||
| 500 | elsif ($pointStyle eq 'square') { | ||
| 501 | my $e0 = int(($pointSize-1)/2); | ||
| 502 | my $e1 = $e0+($pointSize-1)%2; | ||
| 503 | |||
| 504 | $img->filledRectangle( | ||
| 505 | $x[$i]-$e0,$y[$i]-$e0, | ||
| 506 | $x[$i]+$e1,$y[$i]+$e1, | ||
| 507 | $color); | ||
| 508 | } | ||
| 509 | elsif ($pointStyle eq 'circle') { | ||
| 510 | $img->filledArc($x[$i],$y[$i],$pointSize,$pointSize,0,360, | ||
| 511 | $color); | ||
| 512 | } | ||
| 513 | else { | ||
| 514 | $img->throw( | ||
| 515 | 'GD-00009: Unbekannte Punkt-Darstellungsart', | ||
| 516 | PointStyle => $pointStyle, | ||
| 517 | ); | ||
| 518 | } | ||
| 519 | } | ||
| 520 | } | ||
| 521 | |||
| 522 | return; | ||
| 523 | } | ||
| 524 | |||
| 525 | # ----------------------------------------------------------------------------- | ||
| 526 | |||
| 527 | =head2 Objektmethoden | ||
| 528 | |||
| 529 | =head3 xMin() - Minimum des X-Wertebereichs | ||
| 530 | |||
| 531 | =head4 Synopsis | ||
| 532 | |||
| 533 | $xMin = $g->xMin; | ||
| 534 | |||
| 535 | =head4 Description | ||
| 536 | |||
| 537 | Liefere das Minimum des X-Wertebereichs, das entweder beim | ||
| 538 | Konstruktoraufruf gesetzt oder aus den Daten ermittelt wurde. | ||
| 539 | |||
| 540 | =cut | ||
| 541 | |||
| 542 | # ----------------------------------------------------------------------------- | ||
| 543 | |||
| 544 | sub xMin { | ||
| 545 | return shift->{'xMin'}; | ||
| 546 | } | ||
| 547 | |||
| 548 | # ----------------------------------------------------------------------------- | ||
| 549 | |||
| 550 | =head3 xMax() - Maximum des X-Wertebereichs | ||
| 551 | |||
| 552 | =head4 Synopsis | ||
| 553 | |||
| 554 | $xMax = $g->xMax; | ||
| 555 | |||
| 556 | =head4 Description | ||
| 557 | |||
| 558 | Liefere das Maximum des X-Wertebereichs, das entweder beim | ||
| 559 | Konstruktoraufruf gesetzt oder aus den Daten ermittelt wurde. | ||
| 560 | |||
| 561 | =cut | ||
| 562 | |||
| 563 | # ----------------------------------------------------------------------------- | ||
| 564 | |||
| 565 | sub xMax { | ||
| 566 | return shift->{'xMax'}; | ||
| 567 | } | ||
| 568 | |||
| 569 | # ----------------------------------------------------------------------------- | ||
| 570 | |||
| 571 | =head3 yMin() - Minimum des X-Wertebereichs | ||
| 572 | |||
| 573 | =head4 Synopsis | ||
| 574 | |||
| 575 | $yMin = $g->yMin; | ||
| 576 | |||
| 577 | =head4 Description | ||
| 578 | |||
| 579 | Liefere das Minimum des Y-Wertebereichs, das entweder beim | ||
| 580 | Konstruktoraufruf gesetzt oder aus den Daten ermittelt wurde. | ||
| 581 | |||
| 582 | =cut | ||
| 583 | |||
| 584 | # ----------------------------------------------------------------------------- | ||
| 585 | |||
| 586 | sub yMin { | ||
| 587 | return shift->{'yMin'}; | ||
| 588 | } | ||
| 589 | |||
| 590 | # ----------------------------------------------------------------------------- | ||
| 591 | |||
| 592 | =head3 yMax() - Maximum des Y-Wertebereichs | ||
| 593 | |||
| 594 | =head4 Synopsis | ||
| 595 | |||
| 596 | $yMax = $g->yMax; | ||
| 597 | |||
| 598 | =head4 Description | ||
| 599 | |||
| 600 | Liefere das Maximum des Y-Wertebereichs, das entweder beim | ||
| 601 | Konstruktoraufruf gesetzt oder aus den Daten ermittelt wurde. | ||
| 602 | |||
| 603 | =cut | ||
| 604 | |||
| 605 | # ----------------------------------------------------------------------------- | ||
| 606 | |||
| 607 | sub yMax { | ||
| 608 | return shift->{'yMax'}; | ||
| 609 | } | ||
| 610 | |||
| 611 | # ----------------------------------------------------------------------------- | ||
| 612 | |||
| 613 | =head1 VERSION | ||
| 614 | |||
| 615 | 1.240 | ||
| 616 | |||
| 617 | =head1 AUTHOR | ||
| 618 | |||
| 619 | Frank Seitz, L<http://fseitz.de/> | ||
| 620 | |||
| 621 | =head1 COPYRIGHT | ||
| 622 | |||
| 623 | Copyright (C) 2026 Frank Seitz | ||
| 624 | |||
| 625 | =head1 LICENSE | ||
| 626 | |||
| 627 | This code is free software; you can redistribute it and/or modify | ||
| 628 | it under the same terms as Perl itself. | ||
| 629 | |||
| 630 | =cut | ||
| 631 | |||
| 632 | # ----------------------------------------------------------------------------- | ||
| 633 | |||
| 634 | 1; | ||
| 635 | |||
| 636 | # eof |