// http://www.programmingsimplified.com/c/program/draw-bar-chart
// bgi drawBarChart.cpp

#include <graphics.h>
#include <conio.h>
 
main()
{
   initwindow(640, 480, "Bar Chart");
 
   setcolor(YELLOW);
   rectangle(10,30,629,450);
   rectangle(9,29,630,451);
   settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);
   setcolor(WHITE);
   outtextxy(275,0,"Bar Chart");
 
   setlinestyle(SOLID_LINE,0,2);
 
   line(80,420,80,60);
   line(80,420,580,420);
   line(70,70,80,60);
   line(90,70,80,60);
   line(570,410,580,420);
   line(570,430,580,420);
 
   outtextxy(75,35,"Y");
   outtextxy(590,405,"X");
   outtextxy(65,415,"O");
 
   setfillstyle(LINE_FILL,LIGHTBLUE);
   bar(150,100,200,419);
 
   setfillstyle(XHATCH_FILL,LIGHTRED);
   bar(225,150,275,419);
 
   setfillstyle(WIDE_DOT_FILL,LIGHTGREEN);
   bar(300,200,350,419);
 
   setfillstyle(INTERLEAVE_FILL,LIGHTMAGENTA);
   bar(375,125,425,419);
 
   setfillstyle(HATCH_FILL,LIGHTCYAN);
   bar(450,175,500,419);
 
   getch();
   closegraph();
   return 0;
}
