Jump to content
Software FX Community

Is there a good way to pre-determine chart's Height and Width?


samiam1029
 Share

Recommended Posts

Let's say I have a simple chart with Labels series and one data series. There are exactly 12 data points. I create a nice Gannt chart with Height=H and Width=W.

Now let's say there are 16 data points now but I want to show the chart exactly the same way as before i.e. same fonts on both axes, same thickness of bars on Gannt, same spacing between data points etc. How can I determine the new Height=H1 to achieve this result?

I need to be able to do this programatically because the number of data points can only be determined during runtime and the users like the look and feel of the chart I produced with the 12 data points above and they want to keep it that way.

I'm thinking that, if I can specify the number of data points as well as all the formatting info for X and Y axis, then ChartFX should be able to give me Height and Width without rendering the chart.

Any help on this topic would be much appreciated. Thanks!

Link to comment
Share on other sites

  • 1 month later...

Hi samiam1029

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

Unfortunately, I think you cannot achieve calculating the size of the chart base on number of point.  You will need to play with many variables while calculating the width of the chart. For instance:

 

Axis Labels, Chart FX engine will automatically calculate spacing it need to plot labels.

Legend Box, depending of the position of the legend box, the plot area can decrease/increase.  Take into consideration the user can change the legend box position at run time.

 

Good look.

 

-- Pipon

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.

Guest
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.

 Share

×
×
  • Create New...