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