Adds the ability to draw an XY scatter plot. (#27)

* works more or less

* updating comment

* removing debugging printf

* adding output

* tweaks

* missed a couple series validations

* testing auto coloring

* updated output.png

* color tests etc.

* sanity check tests.

* should not use unkeyed fields anyway.
This commit is contained in:
Will Charczuk 2017-03-05 16:54:40 -08:00 committed by GitHub
parent 17b28beae8
commit b713ff85cc
22 changed files with 511 additions and 72 deletions

View file

@ -23,7 +23,7 @@ func parseFloat64(str string) float64 {
func readData() ([]time.Time, []float64) {
var xvalues []time.Time
var yvalues []float64
chart.File.ReadByLines("requests.csv", func(line string) {
err := chart.File.ReadByLines("requests.csv", func(line string) {
parts := strings.Split(line, ",")
year := parseInt(parts[0])
month := parseInt(parts[1])
@ -33,6 +33,9 @@ func readData() ([]time.Time, []float64) {
xvalues = append(xvalues, time.Date(year, time.Month(month), day, hour, 0, 0, 0, time.UTC))
yvalues = append(yvalues, elapsedMillis)
})
if err != nil {
fmt.Println(err.Error())
}
return xvalues, yvalues
}