Skip to content

Commit

Permalink
Add option for aspect ratio.
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Skoda authored and codyfinegan committed Mar 25, 2024
1 parent e161f23 commit d9957c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -1500,6 +1500,10 @@ public function fetch($header = true, $defer_javascript = true)
if(!$defer_javascript)
$foot .= $this->fetchJavascript(true, !$this->namespace);

if ($preserve_aspect_ratio = $this->getOption('preserve_aspect_ratio')) {
$svg['preserveAspectRatio'] = $preserve_aspect_ratio;
}

// add defs to heading
$heading .= $this->defs->get();

Expand Down
1 change: 1 addition & 0 deletions svggraph.ini
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ shadow_offset_y = 5
shadow_blur = 3
link_target = "_blank"
link_base = null
preserve_aspect_ratio = null

[GridGraph]
show_axes = true
Expand Down

0 comments on commit d9957c8

Please sign in to comment.