diff --git a/bar_chart.go b/bar_chart.go index 6a74083..35889d2 100644 --- a/bar_chart.go +++ b/bar_chart.go @@ -362,7 +362,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 = Math.MaxInt(linesBox.Height()+(2*DefaultXAxisMargin), xaxisHeight) + xaxisHeight = Math.MinInt(linesBox.Height()+(2*DefaultXAxisMargin), xaxisHeight) } } diff --git a/draw.go b/draw.go index e06462e..dfa05ba 100644 --- a/draw.go +++ b/draw.go @@ -288,7 +288,7 @@ func (d draw) TextWithin(r Renderer, text string, box Box, style Style) { ty = y } - d.Text(r, line, tx, ty, style) + r.Text(line, tx, ty) y += lineBox.Height() + style.GetTextLineSpacing() } }