computeSize method

void computeSize()

Implementation

void computeSize() {
  String longest = _xAxis!.getLongestLabel();

  axisLabelPaint = PainterUtils.create(axisLabelPaint, null,
      axisLabelPaint!.text!.style!.color, _xAxis!.textSize,
      fontWeight: _xAxis!.typeface?.fontWeight,
      fontFamily: _xAxis!.typeface?.fontFamily);

  final FSize labelSize = Utils.calcTextSize1(axisLabelPaint!, longest);

  final double labelWidth = labelSize.width;
  final double labelHeight =
      Utils.calcTextHeight(axisLabelPaint!, "Q").toDouble();

  final FSize labelRotatedSize = Utils.getSizeOfRotatedRectangleByDegrees(
      labelWidth, labelHeight, _xAxis!.labelRotationAngle);

  _xAxis!.labelWidth = labelWidth.round();
  _xAxis!.labelHeight = labelHeight.round();
  _xAxis!.labelRotatedWidth = labelRotatedSize.width.round();
  _xAxis!.labelRotatedHeight = labelRotatedSize.height.round();

  FSize.recycleInstance(labelRotatedSize);
  FSize.recycleInstance(labelSize);
}