From 74edc12b97f43c670c4ea743d8aacb9b9cd7969e Mon Sep 17 00:00:00 2001 From: EfremovSI Date: Sat, 20 Apr 2024 14:56:45 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BE=D1=82=D0=BB=D0=B0=D0=B4=D0=BA=D0=B8=20SVG=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B0=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 8 +++++--- svg.cpp | 26 ++++++++++++++++++++++++++ svg.h | 13 +++++++++++++ 3 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 svg.cpp create mode 100644 svg.h diff --git a/main.cpp b/main.cpp index c2ead34..97ef452 100644 --- a/main.cpp +++ b/main.cpp @@ -3,7 +3,7 @@ #include #include "histogram.h" #include - +#include @@ -34,13 +34,15 @@ cin >> in.bin_count; return in; } + + + int main() { auto in = input_data(); auto bins = make_histogram(in.numbers, in.bin_count); auto procent = make_histogram_proc(in.numbers, in.bin_count, bins); - show_histogram(in.bin_count, bins, procent); - + show_histogram_svg(bins); return 0; } diff --git a/svg.cpp b/svg.cpp new file mode 100644 index 0000000..94f000c --- /dev/null +++ b/svg.cpp @@ -0,0 +1,26 @@ +#include +#include +#include + +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..0c45c32 --- /dev/null +++ b/svg.h @@ -0,0 +1,13 @@ +#ifndef SVG_H_INCLUDED +#define SVG_H_INCLUDED + +void +svg_begin(double width, double height); + +void +svg_end(); + +void +show_histogram_svg(const std::vector& bins); + +#endif // SVG_H_INCLUDED