~sircmpwn/chartsrv

be94aed9d6fbc49557d2e284d9ed41e8c50a1f78 — Drew DeVault 3 years ago 9ecafe6
Implement &min=...
2 files changed, 6 insertions(+), 3 deletions(-)

M README.md
M main.go
M README.md => README.md +2 -3
@@ 32,9 32,8 @@ set the query parameters as appropriate:
- **stacked**: set to create an area chart instead of a line chart
- **since**: [time.ParseDuration][1] to set distance in the past to start
  charting from
- **width**: chart width in inches
- **height**: chart height in inches
- **width**, **height**: adjust chart dimensions in inches
- **step**: number of seconds between data points
- **max**: maximum Y value
- **min**, **max**: Y axis limits

[1]: https://golang.org/pkg/time/#ParseDuration

M main.go => main.go +4 -0
@@ 190,6 190,10 @@ func main() {
			m, _ := strconv.ParseFloat(ms[0], 64)
			p.Y.Max = m
		}
		if ms, ok := args["min"]; ok {
			m, _ := strconv.ParseFloat(ms[0], 64)
			p.Y.Min = m
		}
		p.Legend.Top = true

		sums := make([]float64, len(data[0].Values))