code: @Override
      protected void onSizeChanged(int w, int h, int oldw, int oldh) {
          super.onSizeChanged(w, h, oldw, oldh);
  
          mWidth = w;
          mHeight = h;
  
          mLeftPadding    = getPaddingLeft();
          mTopPadding     = getPaddingTop();
          mRightPadding   = getPaddingRight();
          mBottomPadding  = getPaddingBottom();
  
          mGraph.layout(mLeftPadding, mTopPadding, w - mRightPadding, (int) (h - mLegendHeight - mBottomPadding));
          mGraphOverlay.layout(mLeftPadding, mTopPadding, w - mRightPadding, (int) (h - mLegendHeight - mBottomPadding));
          mLegend.layout(mLeftPadding, (int) (h - mLegendHeight - mBottomPadding), w - mRightPadding, h - mBottomPadding);
      }
docs: This is called during layout when the size of this view has changed. If
  you were just added to the view hierarchy, you're called with the old
  values of 0.
  
  @param w    Current width of this view.
  @param h    Current height of this view.
  @param oldw Old width of this view.
  @param oldh Old height of this view.