diff --git a/svg.cpp b/svg.cpp
index fba8a7a..c54d176 100644
--- a/svg.cpp
+++ b/svg.cpp
@@ -15,28 +15,14 @@ void svg_end() {
std::cout << "\n";
}
-void svg_text(double left, double baseline, std::string text, std::size_t font_size) {
- std::cout << "" << text << "";
+void svg_text(double left, double baseline, std::string text) {
+ std::cout << "" << text << "";
}
void svg_rect(double x, double y, double width, double height, std::string stroke = "black", std::string fill = "black") {
std::cout << "";
}
-std::size_t in_font_size() {
- std::size_t font_size;
- do{
- std::cerr << "Enter font size >>";
- std::cin >> font_size;
- if (font_size < 8 || font_size > 32) {
- std::cerr << "Please, observe the range 8-32!" << std::endl;
- }
- }while(font_size < 8 || font_size > 32);
-
- return font_size;
-}
-
-
void show_histogram_svg(const std::vector& bins) {
const auto IMAGE_WIDTH = 400;
@@ -46,7 +32,6 @@ void show_histogram_svg(const std::vector& bins) {
const auto TEXT_WIDTH = 50;
const auto BIN_HEIGHT = 30;
const auto BLOCK_WIDTH = 10;
- std::size_t font_size = in_font_size();
const std::size_t MAX_ASTERISK = IMAGE_WIDTH - TEXT_WIDTH;
svg_begin(IMAGE_WIDTH, IMAGE_HEIGHT);
@@ -62,7 +47,7 @@ void show_histogram_svg(const std::vector& bins) {
if (maxbin<=76) {
for (std::size_t i=0; i < bins.size(); i++) {
double bin_width= MAX_ASTERISK * (static_cast(bins[i]) / maxbin);
- svg_text(TEXT_LEFT, top + TEXT_BASELINE, std::to_string(bins[i]), font_size);
+ svg_text(TEXT_LEFT, top + TEXT_BASELINE, std::to_string(bins[i]));
svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT);
top += BIN_HEIGHT;
}
@@ -71,7 +56,7 @@ void show_histogram_svg(const std::vector& bins) {
else {
for (std::size_t i=0; i < bins.size(); i++) {
double bin_width = BLOCK_WIDTH * bins[i];
- svg_text(TEXT_LEFT, top + TEXT_BASELINE, std::to_string(bins[i]), font_size);
+ svg_text(TEXT_LEFT, top + TEXT_BASELINE, std::to_string(bins[i]));
svg_rect(TEXT_WIDTH, top, bin_width, BIN_HEIGHT);
top += BIN_HEIGHT;
}