What are these numbers in the fitting chart to page size example?

0 Answers 56 Views
Charts Drawing PDF Export
Megan
Top achievements
Rank 1
Iron
Iron
Megan asked on 26 Sep 2022, 08:26 PM

Under the export options for charts, there's an example of how to fit a chart to the size of your paper. Part of this example includes some kind of conversion function and a rectangle constant.

function mm(val: number): number {
  return val * 2.8347;
}

const PAGE_RECT = new geometry.Rect([0, 0], [mm(210 - 20), mm(297 - 20)]);

However, there is absolutely no explanation for these numbers. Am I converting to or from millimeters, and what's the other unit? Why am I doing this? Where are these 210 and 297 numbers coming from in the page rectangle? I can see that the minus 20 is accounting for the 1cm margin set in the PDF below, but other than that I have no idea what the origin of these numbers is.

Can someone please translate these magic numbers? Telerik, can you please add comments to the example code explaining?

No answers yet. Maybe you can help?

Tags
Charts Drawing PDF Export
Asked by
Megan
Top achievements
Rank 1
Iron
Iron
Share this question
or