KB-28775: Resizing E3Chart’s legend in the report.

Question:

How can I resize E3Chart’s legend in the report via scripts?

Solution:

To do so, copy the following script to the report’s OnBeforePrint event. The lines in bold are responsible for resizing both the legend and E3Chart:

Sub OnBeforePrint
Set Chart = Report.Sections("PageHeader").Controls("E3Chart1")
set charttela = Application.GetFrame().Screen.Item("E3Chart1")
Chart.CopyConfig(charttela)
Chart.LoadData()
NPens = Chart.Pens.Count
Chart.Legend.Size = NPens*17
Chart.Height = charttela.Height + NPens*17
End Sub

With these lines, you can: check the number of pens in the E3Chart, resize the legend, and resize the E3Chart, respectively.

Print Friendly, PDF & Email

Este artigo foi útil? Was this helpful?

Classificação média - Average rating 0 / 5. Count: 0

Leave a Reply

Your email address will not be published.Required fields are marked *