summaryrefslogtreecommitdiff
path: root/grid.go
diff options
context:
space:
mode:
Diffstat (limited to 'grid.go')
-rw-r--r--grid.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/grid.go b/grid.go
index d759b75..825fa3b 100644
--- a/grid.go
+++ b/grid.go
@@ -186,6 +186,24 @@ func (g GridType) Y(dataY float64) float64 {
return g.ym*dataY + g.yb
}
+// XRange returns the minimum and maximum values for the current tickmark
+// sequence. These correspond to the data values of the graph's left and right
+// edges.
+func (g GridType) XRange() (min, max float64) {
+ min = g.xTicks[0]
+ max = g.xTicks[len(g.xTicks)-1]
+ return
+}
+
+// YRange returns the minimum and maximum values for the current tickmark
+// sequence. These correspond to the data values of the graph's bottom and top
+// edges.
+func (g GridType) YRange() (min, max float64) {
+ min = g.yTicks[0]
+ max = g.yTicks[len(g.yTicks)-1]
+ return
+}
+
// TickmarksContainX sets the tickmarks to be shown by Grid() in the horizontal
// dimension. The argument min and max specify the minimum and maximum values
// to be contained within the grid. The tickmark values that are generated are