diff --git a/main.cpp b/main.cpp index b5cebd7..c8a6784 100644 --- a/main.cpp +++ b/main.cpp @@ -3,6 +3,7 @@ #include #include "histogram.h" #include "text.h" +#include "svg.h" using namespace std; struct Input { vector numbers; @@ -35,6 +36,6 @@ int main() auto in = input_data(); auto bins = make_histogram(in.numbers, in.bin_count); - show_histogram_text(bins, MAX_ASTERISK, in.bin_count); + show_histogram_svg(bins); return 0; } diff --git a/svg.cpp b/svg.cpp new file mode 100644 index 0000000..f1e7428 --- /dev/null +++ b/svg.cpp @@ -0,0 +1,25 @@ +#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..35aeda2 --- /dev/null +++ b/svg.h @@ -0,0 +1,4 @@ +#pragma once + +void +show_histogram_svg(const std::vector& bins); diff --git a/text.cpp b/text.cpp index 5272b36..f7f67bf 100644 --- a/text.cpp +++ b/text.cpp @@ -4,7 +4,7 @@ using namespace std; void -show_histogram_text (const vector& bins,size_t MAX_ASTERISK, size_t bin_count){ +show_histogram_text (const vector& bins, size_t MAX_ASTERISK, size_t bin_count){ double max_count = bins[0]; for (double x: bins){ if (x > max_count) {