Basically the program tracks five years worth of ones Utilities Bill. In this case it is the units and Monthly Cost for Gas, Electric and Water. In C, I had a graph depicting the information for each breakout.

Below is the old C Function that would display the graph for units of Electricity used each month for 60 months. Anyone have an idea how to do this in C++?

Thanks for any assistance you can provide.

Function CODE:

makechart1() { float elecunits[] = { mb[0].kwh, mb[1].kwh, mb[2].kwh, mb[3].kwh, mb[4].kwh, mb[5].kwh, mb[6].kwh, mb[7].kwh, mb[8].kwh, mb[9].kwh, mb[10].kwh, mb[11].kwh, mb[12].kwh, mb[13].kwh, mb[14].kwh, mb[15].kwh, mb[16].kwh, mb[17].kwh, mb[18].kwh, mb[19].kwh, mb[20].kwh, mb[21].kwh, mb[22].kwh, mb[23].kwh, mb[24].kwh, mb[25].kwh, mb[26].kwh, mb[27].kwh, mb[28].kwh, mb[29].kwh, mb[30].kwh, mb[31].kwh, mb[32].kwh, mb[33].kwh, mb[34].kwh, mb[35].kwh, mb[36].kwh, mb[37].kwh, mb[38].kwh, mb[39].kwh, mb[40].kwh, mb[41].kwh, mb[42].kwh, mb[43].kwh, mb[44].kwh, mb[45].kwh, mb[46].kwh, mb[47].kwh, mb[48].kwh, mb[49].kwh, mb[50].kwh, mb[51].kwh, mb[52].kwh, mb[53].kwh, mb[54].kwh, mb[55].kwh, mb[56].kwh, mb[57].kwh, mb[58].kwh, mb[59].kwh, }; chartenv env; _setvideomode(_MAXRESMODE); _setbkcolor(_BLUE); if(_pg_initchart() == 0) { _pg_defaultchart(&env, _PG_COLUMNCHART, _PG_STACKEDBARS); strcpy(env.maintitle.title, "Electrical Units Used"); sprintf( text,"%d %d %d %d %d",yr1,yr1+1,yr1+2,yr1+3,yr1+4); strcpy(env.yaxis.axistitle.title, "E l e c t r i c a l U n i t s"); strcpy(env.xaxis.axistitle.title, text); env.maintitle.titlecolor = _CYAN; env.maintitle.justify = _PG_CENTER; env.yaxis.grid = 1; env.yaxis.axiscolor = 8; env.xaxis.axiscolor = 8; _pg_chart(&env, months, elecunits, 60); while (! kbhit()) {;} } _setvideomode(_DEFAULTMODE); }

*edit: Please use code tags in the future, thanks!

This post has been edited by **Martyr2**: 11 January 2009 - 04:09 PM