MCPcopy Create free account
hub / github.com/elftausend/graplot / axis_desc_x

Function axis_desc_x

src/render/plot.rs:302–313  ·  view source on GitHub ↗
(val: T, x: f32, x_half_font: f32, x_font_size: f32, half_height: f32)

Source from the content-addressed store, hash-verified

300}
301
302fn axis_desc_x<T: std::fmt::Display>(val: T, x: f32, x_half_font: f32, x_font_size: f32, half_height: f32) {
303 let text = format!("{}", val);
304
305 draw_text(
306 &text,
307 x - text.len() as f32 * (x_half_font / 2.),
308 half_height + x_half_font + 7.,
309 x_font_size,
310 COORD_BLACK,
311 );
312 draw_line(x, half_height + 4., x, half_height - 4., 3., COORD_DARKGRAY);
313}

Callers 1

runFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected