summaryrefslogtreecommitdiff
path: root/fpdf_test.go
diff options
context:
space:
mode:
authorKurt <kurt.w.jung@gmail.com>2018-04-03 14:13:52 -0400
committerKurt <kurt.w.jung@gmail.com>2018-04-03 14:13:52 -0400
commit0e1803180e2d0e5dab7f67ed5592974ccc2de7fa (patch)
treecdc55dd891aba55f803ac1c032e761a0319278e2 /fpdf_test.go
parentbc3ff903af0b59e0a5598ced64dfd8713d7959e2 (diff)
Add option to rotate X-axis labels; demonstrate in grid example
Diffstat (limited to 'fpdf_test.go')
-rw-r--r--fpdf_test.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index 26aae6d..bbeb5b0 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -2105,6 +2105,7 @@ func ExampleNewGrid() {
gr.Grid(pdf)
gr = gofpdf.NewGrid(13, 154, 187, 128)
+ gr.XLabelRotate = true
gr.TickmarksExtentX(0, 1, 12)
gr.XDiv = 5
gr.TickmarksContainY(0, 1.1)
@@ -2121,12 +2122,14 @@ func ExampleNewGrid() {
for month, val := range pts {
dot(float64(month)+0.5, val)
}
- pdf.SetDrawColor(0, 0, 0)
- pdf.SetLineWidth(0.1)
+ pdf.SetDrawColor(255, 64, 64)
+ pdf.SetAlpha(0.5, "Normal")
+ pdf.SetLineWidth(1.2)
gr.Plot(pdf, 0.5, 11.5, 50, func(x float64) float64 {
// http://www.xuru.org/rt/PR.asp
return 0.227 * math.Exp(-0.0373*x*x+0.471*x)
})
+ pdf.SetAlpha(1.0, "Normal")
pdf.SetXY(gr.X(0.5), gr.Y(1.35))
pdf.SetFontSize(14)
pdf.Write(0, "Solar energy (MWh) per month, 2016")