From 01e31467cda6378d5d04bf75ca9d447a3d44f4fa Mon Sep 17 00:00:00 2001 From: IshutinaYI Date: Sun, 23 Apr 2023 05:57:09 +0300 Subject: [PATCH] =?UTF-8?q?build:=20=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=B4=D0=B0=20SVG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fin_lab34.cpp | 5 +++-- svg.cpp | 24 ++++++++++++++++++++++++ svg.h | 13 +++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 svg.cpp create mode 100644 svg.h diff --git a/fin_lab34.cpp b/fin_lab34.cpp index fc9a2dc..e6a8f7b 100644 --- a/fin_lab34.cpp +++ b/fin_lab34.cpp @@ -3,6 +3,7 @@ #include #include "histogram.h" #include "text.h" +#include "svg.h" const size_t WINDOW_WIDTH = 80; const size_t MAX_VALUE = WINDOW_WIDTH - 3 - 1; using namespace std; @@ -30,7 +31,7 @@ main(){ double min = 0, max = 0; Input in = input_data(); auto bins = make_histogram(in.numbers, in.bin_count); - for (auto now: bins) {cout << now << endl;} - show_histogram_text(bins); + //for (auto now: bins) {cout << now << endl;} + show_histogram_svg(bins); return 0; } diff --git a/svg.cpp b/svg.cpp new file mode 100644 index 0000000..11f3dfe --- /dev/null +++ b/svg.cpp @@ -0,0 +1,24 @@ +#include +#include +#include "svg.h" +using namespace std; +void +svg_begin(double width, double height) { + cout << "\n"; + cout << "\n"; +} + +void +svg_end() { + cout << "\n"; +} + +void +show_histogram_svg(const vector &bins) { + svg_begin(400, 300); + svg_end(); +} diff --git a/svg.h b/svg.h new file mode 100644 index 0000000..d307e71 --- /dev/null +++ b/svg.h @@ -0,0 +1,13 @@ +#ifndef SVG_H_INCLUDED +#define SVG_H_INCLUDED +#include +using namespace std; +void +svg_begin(double width, double height); + +void +svg_end(); + +void +show_histogram_svg(const vector &bins); +#endif // SVG_H_INCLUDED