19 |
<{ |
<{ |
20 |
|
|
21 |
GD::Image image; |
GD::Image image; |
22 |
image.CreateTrueColor( GD::Size(600,350)); |
image.CreateTrueColor( GD::Size(600,360)); |
23 |
|
|
24 |
//Black color scheme |
//Black color scheme |
25 |
//GD::TrueColor decoration(45,95,0); |
//GD::TrueColor decoration(45,95,0); |
34 |
|
|
35 |
|
|
36 |
image.String(gdFontSmall, 250,5, "Temperature graph", text.Int()); |
image.String(gdFontSmall, 250,5, "Temperature graph", text.Int()); |
37 |
|
image.String(gdFontSmall, 200,18, "Latest 20 samples, in degrees Celcius", text.Int()); |
38 |
|
|
39 |
for (int i=0; i<11; ++i) |
for (int i=0; i<11; ++i) |
40 |
{ |
{ |
41 |
std::stringstream marker; |
std::stringstream marker; |
42 |
marker << (100- (i*10)); |
marker << (100- (i*10)); |
43 |
int y = (i*30) + 25; |
int y = (i*30) + 40; |
44 |
image.Line( 30, y, 590, y, decoration.Int()); |
image.Line( 30, y, 590, y, decoration.Int()); |
45 |
|
|
46 |
image.String(gdFontSmall, 5, y-7, marker.str().c_str(), text.Int()); |
image.String(gdFontSmall, 5, y-7, marker.str().c_str(), text.Int()); |
65 |
for (int i=0; i<res.size(); ++i) |
for (int i=0; i<res.size(); ++i) |
66 |
{ |
{ |
67 |
int current = res[i].getInt(0); |
int current = res[i].getInt(0); |
68 |
int x = (i*28) + 40; |
int x = (i*28) + 45; |
69 |
int y = ((100-current) * 3) + 25; |
int y = ((100-current) * 3) + 40; |
70 |
|
|
71 |
//image.FilledArc( GD::Point(x,y), GD::Size(3,3), 0, 360, line.Int(), gdPie); |
//image.FilledArc( GD::Point(x,y), GD::Size(3,3), 0, 360, line.Int(), gdPie); |
72 |
image.FilledRectangle( GD::Point(x-1,y-1), GD::Point(x+1,y+1), line.Int() ); |
image.FilledRectangle( GD::Point(x-1,y-1), GD::Point(x+1,y+1), line.Int() ); |