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:
parent
43212f871f
commit
03708a90ef
100 changed files with 1687 additions and 1055 deletions
13
legend.go
13
legend.go
|
|
@ -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++
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue