From 0e1803180e2d0e5dab7f67ed5592974ccc2de7fa Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 3 Apr 2018 14:13:52 -0400 Subject: Add option to rotate X-axis labels; demonstrate in grid example --- fpdf_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'fpdf_test.go') 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") -- cgit v1.2.1-24-ge1ad