-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbarChart.cpp
More file actions
56 lines (48 loc) · 966 Bytes
/
barChart.cpp
File metadata and controls
56 lines (48 loc) · 966 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include<iostream>
#include<graphics.h>
#include<conio.h>
using namespace std;
/*
Fill Styles
-----------
EMPTY_FILL
SOLID_FILL
LINE_FILL
LTSLASH_FILL
SLASH_FILL
BKSLASH_FILL
LTBKSLASH_FILL
HATCH_FILL
XHATCH_FILL
INTERLEAVE_FILL
WIDE_DOT_FILL
CLOSE_DOT_FILL
USER_FILL
*/
void drawAxis() {
// Y-Axis
line(100,100,100,500);
// X-Axis
line(100,500,600,500);
}
void drawBars() {
// drawing Bars
setfillstyle(WIDE_DOT_FILL,YELLOW);
bar(150,500,200,200);
setfillstyle(CLOSE_DOT_FILL,WHITE);
bar(225,500,275,300);
setfillstyle(WIDE_DOT_FILL,GREEN);
bar(300,500,350,250);
setfillstyle(CLOSE_DOT_FILL,BLUE);
bar(375,500,425,175);
setfillstyle(CLOSE_DOT_FILL,CYAN);
bar(450,500,500,275);
}
int main() {
initwindow(800,600);
drawAxis();
drawBars();
getch();
closegraph();
return 0;
}