static getMargin()

in src/XAxis.js [135:147]


  static getMargin(props) {
    const { ticksProps, labelsProps, titleProps } = getAxisChildProps(props);
    const margins = [];

    if (props.showTicks) margins.push(XTicks.getMargin(ticksProps));

    if (props.showTitle && props.title)
      margins.push(XAxisTitle.getMargin(titleProps));

    if (props.showLabels) margins.push(XAxisLabels.getMargin(labelsProps));

    return sumMargins(margins, 'margin');
  }