addBox(chart, item) {
    if (!chart.boxes) {
      chart.boxes = [];
    }

    // initialize item with default values
    item.fullSize = item.fullSize || false;
    item.position = item.position || 'top';
    item.weight = item.weight || 0;
    // @ts-ignore
    item._layers = item._layers || function() {
      return [{
        z: 0,
        draw(chartArea) {
          item.draw(chartArea);
        }
      }];
    };

    chart.boxes.push(item);
  }
Register a box to a chart.
A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.
@param {Chart} chart - the chart to use
@param {LayoutItem} item - the item to add to be laid out