impcymru / impcymru-chart-formatter

A VBA module for automatically formatting various charts in Excel
0 stars 1 forks source link

Set chart size #1

Open impcymru-adam-watkins opened 2 years ago

impcymru-adam-watkins commented 2 years ago

Auto-formatting should target a combination of:

The Health Care Data Guide advocates an aspect ratio of 5:2 for charts with a time series on the horizontal axis.

In practice, we might want to target a slightly 'taller' aspect ratio for the ChartArea as a whole, given the impact of titles, captions etc.

By default, Excel seems to create charts that are 7.62 centimetres (3 inches) high.

The Improvement Cymru Simple document Word template has usable width of about 15 centimetres. Targetting an aspect ratio of 5:2 implies a maximum height of about 6 centimetres.

However, as the chart title is currently set to 16pt text, the chart would need to be scaled down to about 70% of its original size for the title text size to roughly match the surrounding paragraph text (11pt divided 16pt). (This is assuming that we do want to follow the Style.ONS thinking on this matter.)

This would imply targetting a height of around 8.6 centimetres (and a width of around 21.5 centimetres). Noting that we might want to target a slightly 'taller' aspect ratio, we might bump the target size to 10cm x 21cm for line/run/control charts.

(Having the chart be 'oversized' for embedding in Word documents means that it's more suitable for pasting into PowerPoint presentations.)

However, this is probably unnecessarily wide for pie charts, horizontal bar charts and line/run/control charts with very few points.

impcymru-adam-watkins commented 2 years ago

10cm x 21cm looks okay for a line/run/control chart with 10 data points (which we generally consider the absolute minimum for a run chart).

Width formula could be something like: min(21, 3+ (1.8 x n_data_points)) ?

impcymru-adam-watkins commented 2 years ago

As it stands, this doesn't work very well (and certainly not very consistently) for bar and column charts.

impcymru-adam-watkins commented 1 year ago

Bar charts are slightly improved now, but not in a very thoughtful manner.

ImpCymru-Jessica-Pang commented 1 year ago

I think the charts look very thin - Would be better to have more horizontal space

impcymru-adam-watkins commented 1 year ago

Can you paste an example of a thin chart?

ImpCymru-Jessica-Pang commented 1 year ago

Moved issue into it's own documentation issue after conversation