From f22e2091eba7531c8640eb5eab2606f1fb4b24f0 Mon Sep 17 00:00:00 2001 From: IshutinaYI Date: Sun, 23 Apr 2023 06:44:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D1=82=D0=B5=D1=81=D1=82=D0=BE=D0=B2=D1=8B=D0=B9=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=BF=D0=B5=D1=80=D0=B2=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D1=81=D1=82=D0=BE=D0=BB=D0=B1=D1=86=D0=B0=20?= =?UTF-8?q?=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=BE?= =?UTF-8?q?=D0=B9=20=D0=B4=D0=B8=D0=B0=D0=B3=D1=80=D0=B0=D0=BC=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fin_lab34.cpp | 1 + svg.cpp | 12 +++++++++++- svg.h | 7 +++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/fin_lab34.cpp b/fin_lab34.cpp index e6a8f7b..aa3620f 100644 --- a/fin_lab34.cpp +++ b/fin_lab34.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "histogram.h" #include "text.h" #include "svg.h" diff --git a/svg.cpp b/svg.cpp index 11f3dfe..e8688a7 100644 --- a/svg.cpp +++ b/svg.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "svg.h" using namespace std; void @@ -16,9 +17,18 @@ void svg_end() { cout << "\n"; } - +void +svg_text(double left, double baseline, string text){ + cout << "" << text << "" << endl; +} +void +svg_rect(double x, double y, double width, double height){ + cout << ""; +} void show_histogram_svg(const vector &bins) { svg_begin(400, 300); + svg_text(20, 20, to_string(bins[0])); + svg_rect(50, 0, bins[0]*10, 30); svg_end(); } diff --git a/svg.h b/svg.h index d307e71..4888808 100644 --- a/svg.h +++ b/svg.h @@ -1,6 +1,7 @@ #ifndef SVG_H_INCLUDED #define SVG_H_INCLUDED #include +#include using namespace std; void svg_begin(double width, double height); @@ -8,6 +9,12 @@ svg_begin(double width, double height); void svg_end(); +void +svg_text(double left, double baseline, string text); + +void +svg_rect(double x, double y, double width, double height); + void show_histogram_svg(const vector &bins); #endif // SVG_H_INCLUDED