Родитель
9a4b65ee9a
Сommit
298322cd64
@ -1,30 +1,47 @@
|
|||||||
# depslib dependency file v1.0
|
# depslib dependency file v1.0
|
||||||
1682273367 source:c:\users\hp\desktop\lab-03\project3\main.cpp
|
1682281180 source:c:\users\hp\desktop\lab-03\project3\main.cpp
|
||||||
<iostream>
|
<iostream>
|
||||||
<vector>
|
<vector>
|
||||||
<cmath>
|
<cmath>
|
||||||
"histogram.h"
|
"histogram.h"
|
||||||
"text.h"
|
"text.h"
|
||||||
|
"svg.h"
|
||||||
|
<string>
|
||||||
|
<conio.h>
|
||||||
|
|
||||||
1682271918 c:\users\hp\desktop\lab-03\project3\histogram.h
|
1682271918 c:\users\hp\desktop\lab-03\project3\histogram.h
|
||||||
<vector>
|
<vector>
|
||||||
|
|
||||||
1682273878 source:c:\users\hp\desktop\lab-03\project3\histogram.cpp
|
1682280773 source:c:\users\hp\desktop\lab-03\project3\histogram.cpp
|
||||||
<iostream>
|
<iostream>
|
||||||
<vector>
|
<vector>
|
||||||
<cmath>
|
<cmath>
|
||||||
"histogram.h"
|
"histogram.h"
|
||||||
"histogram_internal.h"
|
"histogram_internal.h"
|
||||||
|
<conio.h>
|
||||||
|
|
||||||
1682273206 source:c:\users\hp\desktop\lab-03\project3\text.cpp
|
1682280773 source:c:\users\hp\desktop\lab-03\project3\text.cpp
|
||||||
<iostream>
|
<iostream>
|
||||||
<vector>
|
<vector>
|
||||||
<cmath>
|
<cmath>
|
||||||
"text.h"
|
"text.h"
|
||||||
|
<conio.h>
|
||||||
|
|
||||||
1682273446 c:\users\hp\desktop\lab-03\project3\text.h
|
1682273446 c:\users\hp\desktop\lab-03\project3\text.h
|
||||||
<vector>
|
<vector>
|
||||||
|
|
||||||
1682273933 c:\users\hp\desktop\lab-03\project3\histogram_internal.h
|
1682275464 c:\users\hp\desktop\lab-03\project3\histogram_internal.h
|
||||||
|
<vector>
|
||||||
|
|
||||||
|
1682280773 source:c:\users\hp\desktop\lab-03\project3\svg.cpp
|
||||||
|
<math.h>
|
||||||
|
<iostream>
|
||||||
|
<conio.h>
|
||||||
|
<vector>
|
||||||
|
<string>
|
||||||
|
"svg.h"
|
||||||
|
<conio.h>
|
||||||
|
|
||||||
|
1682278136 c:\users\hp\desktop\lab-03\project3\svg.h
|
||||||
<vector>
|
<vector>
|
||||||
|
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
#include <math.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
#include "svg.h"
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
svg_begin(double width, double height) {
|
||||||
|
cout << "<?xml version='1.0' encoding='UTF-8'?>\n";
|
||||||
|
cout << "<svg ";
|
||||||
|
cout << "width='" << width << "' ";
|
||||||
|
cout << "height='" << height << "' ";
|
||||||
|
cout << "viewBox='0 0 " << width << " " << height << "' ";
|
||||||
|
cout << "xmlns='http://www.w3.org/2000/svg'>\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
svg_end() {
|
||||||
|
cout << "</svg>\n";
|
||||||
|
}
|
||||||
|
void
|
||||||
|
svg_text(double left, double baseline, string text) {
|
||||||
|
cout << "<text x='" << left << "' y='" << baseline << "'>" << text << "</text>";
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
show_histogram_svg(const vector<size_t>& bins) {
|
||||||
|
svg_begin(400, 300);
|
||||||
|
svg_text(20, 20, to_string(bins[0]));
|
||||||
|
svg_end();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,7 @@
|
|||||||
|
#ifndef SVG_H_INCLUDED
|
||||||
|
#define SVG_H_INCLUDED
|
||||||
|
#include <vector>
|
||||||
|
void
|
||||||
|
show_histogram_svg(const std::vector<size_t>& bins);
|
||||||
|
|
||||||
|
#endif // SVG_H_INCLUDED
|
Загрузка…
Ссылка в новой задаче