From ec765e16b4135160120b20e82179c02e7acc561a Mon Sep 17 00:00:00 2001 From: SukhotinMD Date: Thu, 29 May 2025 06:31:16 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D1=86=D0=B2=D0=B5=D1=82=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ARM64/Debug/marks.svg | 2 +- ProgUit Lab1/text.cpp | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ARM64/Debug/marks.svg b/ARM64/Debug/marks.svg index 56afc53..d894513 100644 --- a/ARM64/Debug/marks.svg +++ b/ARM64/Debug/marks.svg @@ -1,5 +1,5 @@ 2 - + diff --git a/ProgUit Lab1/text.cpp b/ProgUit Lab1/text.cpp index de37dc6..9413993 100644 --- a/ProgUit Lab1/text.cpp +++ b/ProgUit Lab1/text.cpp @@ -29,15 +29,27 @@ svg_text(double left, double baseline, string text) { cout << "" << text << "" << endl; } -void svg_rect(double x, double y, double width, double height) { - cout << "" << endl; +void svg_rect(double x, double y, double width, double height, string stroke, string fill) { + cout << "" << endl; } void show_histogram_svg(const vector bins) { + + const auto IMAGE_WIDTH = 400; + const auto IMAGE_HEIGHT = 300; + const auto TEXT_LEFT = 20; + const auto TEXT_BASELINE = 20; + const auto TEXT_WIDTH = 50; + const auto BIN_HEIGHT = 30; + const auto BLOCK_WIDTH = 10; + + + + svg_begin(400, 300); svg_text(20, 35, to_string(bins[0])); - svg_rect(50, 0, bins[0] * 10, 30); + svg_rect(50, 0, bins[0] * 10, 30, "purple", "red"); svg_end(); }