code: private void calculate(final int WIDTH, final int HEIGHT) {
          // Set start and stop values
          start = DATA_LIST.getFirst().getValue();
          stop = DATA_LIST.getLast().getValue();
  
          // Find min and max values
          lo = DATA_LIST.getFirst().getValue();
          hi = DATA_LIST.getFirst().getValue();
          loIndex = 0;
          hiIndex = 0;
          final int SIZE = DATA_LIST.size();
          double y;
          for (int index = 0; index < SIZE; index++) {
              y = DATA_LIST.get(index).getValue();
              calcHiLoValues(y, index);
          }
  
          // Calculate the range from min to max
          rangeY = hi - lo;
  
          // Calculate the offset between the graph and the border
          //offset = (double) HEIGHT * OFFSET_FACTOR;
  
          // Calculate the scaling in x- and y-direction
          scaleY = rangeY / ((double) HEIGHT - (offset * 2));
  
          // Fill the pointlist with smoothing if possible
          pointList.clear();
          if (DATA_LIST.size() > 5 && smoothing) {
              smoothData();
          } else {
              for (int index = 0; index < SIZE; index++) {
                  pointList.add(new Point2D.Double((DATA_LIST.get(index).getTimeStamp() - DATA_LIST.getFirst().getTimeStamp()) * pixelResolution, ((DATA_LIST.get(index).getValue() - lo) * (1 / scaleY) + offset)));
              }
          }
  
          // Calculate average and normal area if one of them is visible
          if (averageVisible || normalAreaVisible) {
              final double AVERAGE = (getAverage() - lo) * (1 / scaleY) + offset;
              final double STANDARD_DEVIATION = (getStandardDeviation() * (1 / scaleY));
              NORMAL_AREA.setRect(INNER_BOUNDS.x, AVERAGE - STANDARD_DEVIATION, INNER_BOUNDS.width, 2 * STANDARD_DEVIATION);
              AVERAGE_LINE.setLine(INNER_BOUNDS.x, AVERAGE, INNER_BOUNDS.x + INNER_BOUNDS.width, AVERAGE);
          }
      }
docs: Calculates the sparkline with all it's parameters. This methods
  will be called everytime a new value was added to the DATA_LIST
  @param WIDTH
  @param HEIGHT