This commit is contained in:
Will Charczuk 2019-02-13 16:09:26 -08:00
parent 3cb33d48d3
commit 26eaa1d898
76 changed files with 1076 additions and 1717 deletions

View file

@ -7,7 +7,6 @@ import (
"math"
"github.com/golang/freetype/truetype"
util "github.com/wcharczuk/go-chart/util"
)
// BarChart is a chart that draws bars on a range.
@ -410,7 +409,7 @@ func (bc BarChart) getAdjustedCanvasBox(r Renderer, canvasBox Box, yrange Range,
lines := Text.WrapFit(r, bar.Label, barLabelBox.Width(), axisStyle)
linesBox := Text.MeasureLines(r, lines, axisStyle)
xaxisHeight = util.Math.MinInt(linesBox.Height()+(2*DefaultXAxisMargin), xaxisHeight)
xaxisHeight = MinInt(linesBox.Height()+(2*DefaultXAxisMargin), xaxisHeight)
}
}
@ -477,7 +476,7 @@ func (bc BarChart) styleDefaultsTitle() Style {
}
func (bc BarChart) getTitleFontSize() float64 {
effectiveDimension := util.Math.MinInt(bc.GetWidth(), bc.GetHeight())
effectiveDimension := MinInt(bc.GetWidth(), bc.GetHeight())
if effectiveDimension >= 2048 {
return 48
} else if effectiveDimension >= 1024 {