summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.name>2019-09-27 18:12:54 +0100
committerNick White <git@njw.name>2019-09-27 18:12:54 +0100
commit99f716ceb58b72016a7828d6956a1160e4346737 (patch)
tree162871e49806ea32645cce558b7b71ab8d6fcc50
parentec6db29175f1d94d1d0dc79714c4cb050b64a700 (diff)
Fix crash bug when graph was used on source with less than 10 pages
-rw-r--r--bookpipeline/graph.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/bookpipeline/graph.go b/bookpipeline/graph.go
index acd015e..955abbd 100644
--- a/bookpipeline/graph.go
+++ b/bookpipeline/graph.go
@@ -66,6 +66,9 @@ func Graph(confs map[string]*Conf, bookname string, w io.Writer) error {
var annotations []chart.Value2
var ticks []chart.Tick
tickevery := len(graphconf) / maxticks
+ if tickevery < 1 {
+ tickevery = 1
+ }
for i, c := range graphconf {
xvalues = append(xvalues, c.Pgnum)
yvalues = append(yvalues, c.Conf)