Jump to content
Software FX Community

Calculating Height


Recommended Posts

When working with horizontal charts with variable number of points, multiple titles etc. what would be the best approach to calculate the height of the chart, to keep the "natural" size of bars and fonts heights and avoid visual distortion if the height is not set properly ?



Link to comment
Share on other sites

We will not scale the fonts used in the chart, so the only problem is that a chart with too many points may not show all labels.

The size devoted to the "plot area" is calculated depending on the titles (and their location), note that the font used in the title will make a difference, we also have a set of minimum gaps which you can modify using the PlotAreaMargins property.

It is hard to give you an exact formula for the best height as our calculations also include the axes (font is important here as well). If the number of titles is static and you are not changing the fonts, you can safely assume the extra space will be about the same (98 pixels in the image you sent), so you may want to set the chart height to 98 + numPoints*desiredBarHeight


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...