code: индивидуально задание (вариант 5) сделано

main
Danila 2 лет назад
Родитель 04bc659881
Сommit 17c57fda8d

@ -67,8 +67,8 @@ show_histogram_svg(const vector<size_t>& bins)
for (size_t bin : bins)
{
double bin_width = (MAX_WIDTH)*(bin/max_count);
svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bin));
svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT, BLACK, RED);
svg_rect(MAX_WIDTH-bin_width, top, bin_width, BIN_HEIGHT, BLACK, RED);
svg_text(TEXT_LEFT+MAX_WIDTH, top + TEXT_BASELINE, to_string(bin));
top += BIN_HEIGHT;
}

Загрузка…
Отмена
Сохранить