Ok here's what I did (and it seems to work) :
in MigraDocLite\MigraDoc.Rendering\MigraDoc.Rendering\TopDownFormatter.cs
Inside public void FormatOnAreas(XGraphics gfx, bool topLevel)
Change
Code:
DocumentObject docObj = this.elements[idx];
Renderer renderer = Renderer.Create(gfx, this.documentRenderer, docObj, this.areaProvider.AreaFieldInfos);
renderer.MaxElementHeight = maxHeight;
if (topLevel && this.documentRenderer.HasPrepareDocumentProgress)
{
this.documentRenderer.OnPrepareDocumentProgress(this.documentRenderer.ProgressCompleted + idx + 1,
this.documentRenderer.ProgressMaximum);
}
// "Slightly hacked" for legends: they are rendered as part of the chart.
// So they are skipped here.
if (renderer == null)
{
ready = idx == this.elements.Count - 1;
if (ready)
this.areaProvider.StoreRenderInfos(renderInfos);
++idx;
continue;
}
to
Code:
DocumentObject docObj = this.elements[idx];
Renderer renderer = Renderer.Create(gfx, this.documentRenderer, docObj, this.areaProvider.AreaFieldInfos);
if (topLevel && this.documentRenderer.HasPrepareDocumentProgress)
{
this.documentRenderer.OnPrepareDocumentProgress(this.documentRenderer.ProgressCompleted + idx + 1,
this.documentRenderer.ProgressMaximum);
}
// "Slightly hacked" for legends: they are rendered as part of the chart.
// So they are skipped here.
if (renderer == null)
{
ready = idx == this.elements.Count - 1;
if (ready)
this.areaProvider.StoreRenderInfos(renderInfos);
++idx;
continue;
}
renderer.MaxElementHeight = maxHeight;
(I moved the renderer.MaxElementHeight = maxHeight ...)