Pulling 100% inside the canvasBox to remain visible.
This commit is contained in:
parent
fead23ae5b
commit
9235c2e7ab
2 changed files with 5 additions and 0 deletions
Binary file not shown.
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 34 KiB |
|
@ -316,6 +316,11 @@ func (sbc StackedBarChart) drawHorizontalXAxis(r Renderer, canvasBox Box) {
|
||||||
textBox := r.MeasureText(text)
|
textBox := r.MeasureText(text)
|
||||||
textX := tx - (textBox.Width() >> 1)
|
textX := tx - (textBox.Width() >> 1)
|
||||||
textY := canvasBox.Bottom + DefaultXAxisMargin + 10
|
textY := canvasBox.Bottom + DefaultXAxisMargin + 10
|
||||||
|
|
||||||
|
if t == 1 {
|
||||||
|
textX = canvasBox.Right - textBox.Width()
|
||||||
|
}
|
||||||
|
|
||||||
Draw.Text(r, text, textX, textY, axisStyle)
|
Draw.Text(r, text, textX, textY, axisStyle)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue