My solution to this problem is to use the following process:
Divide the number of data samples by the double width of your computer screen in pixels
Read data from file in chunks this size
As each chunk is read use one of the following methods:
Calculate the mean of data in each chunk (This will average data shown in each pixel)
or
Calculate the minimum and maximum values in each chunk (This will show all peaks in the data, this is typically ideal)
Feed each resulting data point into an array (If the minimum/maximum method is used I place both points in an array in the order in which they occur.
Using this method will lower the amount of data stored in the system memory at one time. Because there are more data points available than the size of the screen, you will essentially see the same data as if all data was loaded onto the graph.
Note that if you zoom in on the data, the process will have to be repeated for the range of data to make sure that you have the proper resolution.