const int x_right_bound = rightedge - x_left_bound;
const int x_legend = min(max(x_tick, x_left_bound), x_right_bound);
p.drawText(x_legend, ValueMargin, 0, text_height,
const int x_right_bound = rightedge - x_left_bound;
const int x_legend = min(max(x_tick, x_left_bound), x_right_bound);
p.drawText(x_legend, ValueMargin, 0, text_height,