Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bar graphs

Status
Not open for further replies.

INDO

Programmer
Mar 18, 2001
12
0
0
US
I am trying to create a bar graph using the MoveTo and LineTo methods.
This is the code for the original display, I am trying to convert to a bar graph.

Any pointers please?


if (initialised){
Canvas->MoveTo(20,199 - 2* DataEngine1.NextItem());
for (Count = 2; Count <+DataEngine.Size(); Count = Count+1;
{
for Canvas->LineTo((Count - 1) *20,199 - 2 *DataEngine1.NextItem());
}



 
Hello,

Since you are using BGI, check out the bgidemo-example that comes with the compiler. It has a 2D and 3D bar-graph in it.

Wouter Dijkslag

 
Hi, there!
It looks like we've got the same problem (I recognised the magic &quot;DataEngine1&quot;). I think a two-dimensional array will have to be initialised from the data file (&quot;Q3Data.dat&quot; sounds familiar?). Then it would be possible to use the TGraph component instead of the Canvass methods: the first index would give us the x-axis coordinates, the second - the y-axis ones. To be honest, I don't think we can use the DataEngine1 at all, its methods don't draw histogramms - just blooming zigzags! What do you think?

cluelessC X-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top