Thursday, 15 August 2013

graphics - c++ using text files to make graphs -


So I want to use large files with big names, and the names being used each year since 1880 Frequency of There is a text file for each year with names and frequencies. I need to read in the text files and the user input has a name and a year, which they want to see the frequency (which is not my problem, I can do this). When the user inputs in the name and the year, however, I should see a line graph which shows the frequency of the name as y-axis and the year shows as X-axis. I am using Marro which allows the use of graphics and which is not, but where should I start? I have lost a lot on how to do this.

Before I was doing something similar (but in ASCII), I quickly realized There were two options: A) The graph would not look well, and in fact the only SCREEN_WIDTH years would fit, B) The graph will only show the most interesting year C) The graph will not fit on a screen. D) You will not agree to somehow suitable for a screen.

Personally I select the option C, which can be solved as follows: Each column is one year (or a year category). Set that column's line at the same height as the "value" color equal to "COLORED".

There is only one problem in the number of rows, because we can only fit the SCREEN_HEIGHT elements in there. Unless, the shape of the line was shown, it was acceptable for me, so the sacrifice of precision was worth it.

No comments:

Post a Comment