From 117884605d115d0996d9b713c2a4e836a477f0b4 Mon Sep 17 00:00:00 2001 From: "Alice (SemenovIA)" Date: Mon, 28 Oct 2024 00:31:56 +0300 Subject: [PATCH] =?UTF-8?q?build:=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/lab34.cbp | 11 +++++++++++ project/show_histogram.cpp | 10 ++-------- project/unittest.cpp | 6 ------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/project/lab34.cbp b/project/lab34.cbp index a01ffa6..7ccab18 100644 --- a/project/lab34.cbp +++ b/project/lab34.cbp @@ -32,7 +32,18 @@ + + + + + + + + + + + diff --git a/project/show_histogram.cpp b/project/show_histogram.cpp index 9693632..309dec0 100644 --- a/project/show_histogram.cpp +++ b/project/show_histogram.cpp @@ -1,5 +1,5 @@ #include "svg.h" -#include "percent.h" + void show_histogram_svg(const vector& bins) { @@ -32,7 +32,7 @@ show_histogram_svg(const vector& bins) { const double bin_width = BLOCK_WIDTH * bin; if (bin == longest){ svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bin)); - svg_rect(TEXT_WIDTH, top, IMAGE_WIDTH - 2*TEXT_WIDTH, BIN_HEIGHT, "#000000", "#ff00a2"); + svg_rect(TEXT_WIDTH, top, IMAGE_WIDTH - TEXT_WIDTH, BIN_HEIGHT, "#000000", "#ff00a2"); top += BIN_HEIGHT; } else{ svg_text(TEXT_LEFT, top + TEXT_BASELINE, to_string(bin)); @@ -40,11 +40,5 @@ show_histogram_svg(const vector& bins) { top += BIN_HEIGHT; } } - top = 0; - percent(bins, bins_percent); - for (size_t bin_percent : bins_percent){ - svg_text(IMAGE_WIDTH - TEXT_WIDTH + TEXT_LEFT, top + TEXT_BASELINE, to_string(bin_percent)+"%"); - top += BIN_HEIGHT; - } svg_end(); } diff --git a/project/unittest.cpp b/project/unittest.cpp index 35c8854..fe025be 100644 --- a/project/unittest.cpp +++ b/project/unittest.cpp @@ -39,9 +39,3 @@ TEST_CASE("distinct negative numbers") { CHECK(min == -4); CHECK(max == -1.5); } -TEST_CASE("percent 1") { - const vectorbins{5, 10, 10, 50, 25}; - vectorbins_percent{}; - percent(bins, bins_percent); - CHECK(bins_percent[0] == 5); -}