code: function (redraw) {
              var titleOffset = 0,
                title = this.title,
                subtitle = this.subtitle,
                options = this.options,
                titleOptions = options.title,
                subtitleOptions = options.subtitle,
                requiresDirtyBox,
                renderer = this.renderer,
                autoWidth = this.spacingBox.width - 44; // 44 makes room for default context button
  
              if (title) {
                  title
                    .css({ width: (titleOptions.width || autoWidth) + PX })
                    .align(extend({
                        y: renderer.fontMetrics(titleOptions.style.fontSize, title).b - 3
                    }, titleOptions), false, 'spacingBox');
  
                  if (!titleOptions.floating && !titleOptions.verticalAlign) {
                      titleOffset = title.getBBox().height;
                  }
              }
              if (subtitle) {
                  subtitle
                    .css({ width: (subtitleOptions.width || autoWidth) + PX })
                    .align(extend({
                        y: titleOffset + (titleOptions.margin - 13) + renderer.fontMetrics(titleOptions.style.fontSize, subtitle).b
                    }, subtitleOptions), false, 'spacingBox');
  
                  if (!subtitleOptions.floating && !subtitleOptions.verticalAlign) {
                      titleOffset = mathCeil(titleOffset + subtitle.getBBox().height);
                  }
              }
  
              requiresDirtyBox = this.titleOffset !== titleOffset;
              this.titleOffset = titleOffset; // used in getMargins
  
              if (!this.isDirtyBox && requiresDirtyBox) {
                  this.isDirtyBox = requiresDirtyBox;
                  // Redraw if necessary (#2719, #2744)
                  if (this.hasRendered && pick(redraw, true) && this.isDirtyBox) {
                      this.redraw();
                  }
              }
          }
docs: Lay out the chart titles and cache the full offset height for use in getMargins