Helper API refactor (#40)

* api cleaup

* updates

* wtf

* updates

* snapshot.

* tweaks

* snapshot

* api tweaks.

* updates

* updates

* updates

* changes.

* updates

* updates

* sequence => seq

* dont need to use curl, just using wget

* fixing examples
This commit is contained in:
Will Charczuk 2017-05-12 17:12:23 -07:00 committed by GitHub
parent 43212f871f
commit 03708a90ef
100 changed files with 1687 additions and 1055 deletions

View file

@ -1,6 +1,9 @@
package chart
import "github.com/wcharczuk/go-chart/drawing"
import (
"github.com/wcharczuk/go-chart/drawing"
"github.com/wcharczuk/go-chart/util"
)
// Legend returns a legend renderable function.
func Legend(c *Chart, userDefaults ...Style) Renderable {
@ -66,7 +69,7 @@ func Legend(c *Chart, userDefaults ...Style) Renderable {
}
legendContent.Bottom += tb.Height()
right := legendContent.Left + tb.Width() + lineTextGap + lineLengthMinimum
legendContent.Right = Math.MaxInt(legendContent.Right, right)
legendContent.Right = util.Math.MaxInt(legendContent.Right, right)
labelCount++
}
}
@ -161,8 +164,8 @@ func LegendThin(c *Chart, userDefaults ...Style) Renderable {
for x := 0; x < len(labels); x++ {
if len(labels[x]) > 0 {
textBox = r.MeasureText(labels[x])
textHeight = Math.MaxInt(textBox.Height(), textHeight)
textWidth = Math.MaxInt(textBox.Width(), textWidth)
textHeight = util.Math.MaxInt(textBox.Height(), textHeight)
textWidth = util.Math.MaxInt(textBox.Width(), textWidth)
}
}
@ -278,7 +281,7 @@ func LegendLeft(c *Chart, userDefaults ...Style) Renderable {
}
legendContent.Bottom += tb.Height()
right := legendContent.Left + tb.Width() + lineTextGap + lineLengthMinimum
legendContent.Right = Math.MaxInt(legendContent.Right, right)
legendContent.Right = util.Math.MaxInt(legendContent.Right, right)
labelCount++
}
}