Skip to content

Commit

Permalink
Add better defaults (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
maantje authored Jan 23, 2025
1 parent dc71ce0 commit c1f73c9
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 32 deletions.
8 changes: 4 additions & 4 deletions examples/output/advanced-bar-chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions examples/output/advanced-line-chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions examples/output/mixed-chart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/output/report.pdf
Binary file not shown.
2 changes: 0 additions & 2 deletions examples/pdf/mpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@
new YAxisLineAnnotation(
y: 57,
color: $red,
dash: '0', // mpdf?
label: 'Halfway',
textLeftMargin: -2,
textTopMargin: -2,
Expand Down Expand Up @@ -561,7 +560,6 @@
new XAxisLineAnnotation(
x: 225,
color: $green,
dash: '0', // mpdf?
label: 'Halfway',
textLeftMargin: -2,
textTopMargin: -2,
Expand Down
4 changes: 2 additions & 2 deletions src/Annotations/PointAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ public function __construct(
public ?string $yAxis = null,
public int $markerSize = 5,
public string $markerBackgroundColor = '',
public string $markerBorderColor = '',
public string $markerBorderColor = 'none',
public int $markerBorderWidth = 0,
public string $label = '',
public string $labelColor = 'white',
public string $labelBackgroundColor = 'red',
public string $labelBorderColor = '',
public string $labelBorderColor = 'none',
public int $labelBorderWidth = 0,
public int $labelOffsetY = 20,
public int $labelPaddingX = 20,
Expand Down
4 changes: 2 additions & 2 deletions src/Annotations/XAxis/XAxisLineAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ public function __construct(
public string $color,
public int $size = 2,
public ?int $fontSize = null,
public string $dash = '',
public string $dash = 'none',
public string $label = '',
public string $labelColor = 'white',
public string $labelBackgroundColor = '',
public string $labelBorderColor = '',
public string $labelBorderColor = 'none',
public int $labelBorderWidth = 0,
public int $labelOffsetX = 20,
public int $textLeftMargin = 0,
Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/XAxis/XAxisRangeAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __construct(
public string $label = '',
public string $labelColor = 'white',
public string $labelBackgroundColor = '',
public string $labelBorderColor = '',
public string $labelBorderColor = 'none',
public int $labelBorderWidth = 0,
public int $labelOffsetX = 20,
public int $labelPaddingX = 20,
Expand Down
4 changes: 2 additions & 2 deletions src/Annotations/YAxis/YAxisLineAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public function __construct(
public string $color = 'yellow',
public int $size = 2,
public ?int $fontSize = null,
public string $dash = '',
public string $dash = 'none',
public string $label = '',
public string $labelColor = 'white',
public string $labelBackgroundColor = '',
public string $labelBorderColor = '',
public string $labelBorderColor = 'none',
public int $labelBorderWidth = 0,
public int $labelOffsetY = -5,
public int $labelOffsetX = 10,
Expand Down
2 changes: 1 addition & 1 deletion src/Annotations/YAxis/YAxisRangeAnnotation.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(
public string $label = '',
public string $labelColor = 'white',
public string $labelBackgroundColor = '',
public string $labelBorderColor = '',
public string $labelBorderColor = 'none',
public int $labelBorderWidth = 0,
public int $labelOffsetY = 8,
public int $labelOffsetX = 10,
Expand Down
2 changes: 1 addition & 1 deletion src/SVG/TextResizeableRect.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function __construct(
private string $fontFamily = 'Arial',
private int $fontSize = 16,
private string $rectFill = 'black',
private string $rectStroke = '',
private string $rectStroke = 'none',
private int $rectStrokeWidth = 0,
private int $rectRx = 0,
private int $rectRy = 0,
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/AnnotationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@
<circle cx="60" cy="550" r="10" fill="white" stroke="red" stroke-width="4">
<title>0</title>
</circle>
<rect x="27.727272727273" y="502.63636363636" width="64.545454545455" height="22" fill="red" fill-opacity="1" stroke="" stroke-width="0" rx="0" ry="0">
<rect x="27.727272727273" y="502.63636363636" width="64.545454545455" height="22" fill="red" fill-opacity="1" stroke="none" stroke-width="0" rx="0" ry="0">
<title/>
</rect>
<text x="60" y="520" font-family="arial" font-size="14" fill="white" stroke="none" stroke-width="0" text-anchor="middle" dominant-baseline="alphabetic" alignment-baseline="auto">Point 1</text>
<line x1="60" y1="287.5" x2="770" y2="287.5" stroke="blue" stroke-dasharray="" stroke-width="3"/>
<rect x="60" y="262.13636363636" width="128.18181818182" height="22" fill="blue" fill-opacity="1" stroke="" stroke-width="0" rx="0" ry="0">
<line x1="60" y1="287.5" x2="770" y2="287.5" stroke="blue" stroke-dasharray="none" stroke-width="3"/>
<rect x="60" y="262.13636363636" width="128.18181818182" height="22" fill="blue" fill-opacity="1" stroke="none" stroke-width="0" rx="0" ry="0">
<title/>
</rect>
<text x="70" y="279.5" font-family="arial" font-size="14" fill="white" stroke="none" stroke-width="0" text-anchor="start" dominant-baseline="alphabetic" alignment-baseline="auto">Y Axis annotation</text>
<rect x="415" y="25" width="355" height="525" fill="pink" fill-opacity="0.2" stroke="none" stroke-width="0" rx="0" ry="0">
<title/>
</rect>
<rect x="425" y="517.63636363636" width="166.36363636364" height="22" fill="pink" fill-opacity="1" stroke="" stroke-width="0" rx="0" ry="0">
<rect x="425" y="517.63636363636" width="166.36363636364" height="22" fill="pink" fill-opacity="1" stroke="none" stroke-width="0" rx="0" ry="0">
<title/>
</rect>
<text x="435" y="535" font-family="arial" font-size="14" fill="white" stroke="none" stroke-width="0" text-anchor="start" dominant-baseline="alphabetic" alignment-baseline="auto">X Axis range annotation</text>
Expand Down

0 comments on commit c1f73c9

Please sign in to comment.