size returns the height of the axis.
()
| 234 | |
| 235 | // size returns the height of the axis. |
| 236 | func (a horizontalAxis) size() (h vg.Length) { |
| 237 | if a.Label.Text != "" { // We assume that the label isn't rotated. |
| 238 | h += a.Label.TextStyle.Height(a.Label.Text) |
| 239 | h += a.Label.Padding |
| 240 | } |
| 241 | |
| 242 | marks := a.Tick.Marker.Ticks(a.Min, a.Max) |
| 243 | if len(marks) > 0 { |
| 244 | if a.drawTicks() { |
| 245 | h += a.Tick.Length |
| 246 | } |
| 247 | h += tickLabelHeight(a.Tick.Label, marks) |
| 248 | } |
| 249 | h += a.Width / 2 |
| 250 | h += a.Padding |
| 251 | |
| 252 | return h |
| 253 | } |
| 254 | |
| 255 | // draw draws the axis along the lower edge of a draw.Canvas. |
| 256 | func (a horizontalAxis) draw(c draw.Canvas) { |
no test coverage detected