code: protected void calculateBarPositions(int _DataSize) {
  
          int   dataSize = mScrollEnabled ? mVisibleBars : _DataSize;
          float barWidth = mBarWidth;
          float margin   = mBarMargin;
  
          if (!mFixedBarWidth) {
              // calculate the bar width if the bars should be dynamically displayed
              barWidth = (mAvailableScreenSize / _DataSize) - margin;
          } else {
  
              if(_DataSize < mVisibleBars) {
                  dataSize = _DataSize;
              }
  
              // calculate margin between bars if the bars have a fixed width
              float cumulatedBarWidths = barWidth * dataSize;
              float remainingScreenSize = mAvailableScreenSize - cumulatedBarWidths;
  
              margin = remainingScreenSize / dataSize;
          }
  
          boolean isVertical = this instanceof VerticalBarChart;
  
          int calculatedSize = (int) ((barWidth * _DataSize) + (margin * _DataSize));
          int contentWidth   = isVertical ? mGraphWidth : calculatedSize;
          int contentHeight  = isVertical ? calculatedSize : mGraphHeight;
  
          mContentRect       = new Rect(0, 0, contentWidth, contentHeight);
          mCurrentViewport   = new RectF(0, 0, mGraphWidth, mGraphHeight);
  
          calculateBounds(barWidth, margin);
          mLegend.invalidate();
          mGraph.invalidate();
      }
docs: Calculates the bar width and bar margin based on the _DataSize and settings and starts the boundary
  calculation in child classes.
  @param _DataSize Amount of data sets