There are four options I can think of for handling this:

The first is sampling, like if there are 500 data points and you have a 100 pixel wide area to draw in, you draw ever 5th pixel. This method is fast, but if the samle rate becomes too low, like if you were drawing every 100th pixel, the graph may appear chaotic.

The second is averaging. Again if there are 500 data points and you have 100 pixel wide area to draw in, you would average groups of 5 pixels and draw the averages. This method is a little slower, but it does not become usually "chaotic" for large "compressions" However, it may begin to become 0 for large compressions. i.e you might see that the graph tends to just become 0, or near 0 much of the time.

continues