Hi

I've written a piece of code that takes a timeseries of data, and display them like a linegraph. Now, I want to add normalized zones, where the data is displayed more compress / less compressed than on the normal area

Example:
Range of graph:0 - 100
Normalized area low. 0-20

Normalized area high 50-100

Normalized area's is 1/4 of the graph

Now, the real question is:
1
How can i rewrite this code so that if one of the normalized areas is removed, the graph would still work?

2
Is there a more efficient way to do this? Maybe I want even more normalized areas, and perhaps I want it to work with negative numbers as well

Some code so far
VB Code:
  1. If value < lowlowlow Then
  2. calculatedValue = picture1.height + 500 'Out of graph area
  3.     ElseIf value <= low Then
  4.          area = (picture1.height / 4) / (low - lowlow)
  5.          calculatedValue = (picture1.height) - (area * (value - lowlow))
  6.     ElseIf value <= highhigh Then
  7.         area = (picture1.height / 4) / (highhigh - high)
  8.         calculatedValue = area * (highhigh - value)
  9.     ElseIf value > highhighhigh Then
  10.         calculatedValue = -500 'Out of graph area
  11.     End If