Jump to content
Sign in to follow this  
stanley

xmChart scaling issues

Recommended Posts

Hi all:

I'm working on a solution using xmChart, which I've used a number of times before. However, I am trying to force xmChart to produce pie charts where the pie is always the same size. What normally happens is that the chart as a whole is a set size and, depending on the length of the labels, the pie in the middle is smaller or larger. I am currently working an a very elaborate algorithm to calculate the lengths and positions of all the labels, in order to set the chart to the right size. Has anyone done anything like this before?

Really, I'm just trying to save myself some work.

-Stanley

Share this post


Link to post
Share on other sites

Hey stanley,

I made an interface file to give the user control of most of the different options, like size, colors, PieChartOptions, what the labels are and how they are displayed. The data string is sent to the interface file by whichever database groups the data, then the interface file lets the user customize the chart.

But I think your algorithm for scaling by length of the labels is a reasonable approach. I do a similar thing (setting the default chart dimensions) based on the number of series in bar charts.

Share this post


Link to post
Share on other sites

Ender:

Thanks for the input. Unfortunately, the solution I'm working on involves batch-processing hundreds of reports at once and printing them out, so there's no point giving the user control over the appearance of the chart.

Back to the crazy mathematics.

-Stanley

Share this post


Link to post
Share on other sites

Thanks Ender - I can't tell you how happy I am to be an "old hand" rather than an "addict."

Share this post


Link to post
Share on other sites

I'm quite new with xmChart, but... would it make any difference if you were to draw the graphic pie portion in one chart and the labels separately, in another, overlaying them?

Chris

Share this post


Link to post
Share on other sites

Overlaying doesn't work for a number of reasons. The solution I came up with was to concatenate the labels to a specific length and also to put a carriage return into them, in order to control the width of the labels. This gave me a result where all the pies (in a system with about 5000 records) were within 5% of each other in size, which was good enough.

-Stanley

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
    john9210 
×

Important Information

By using this site, you agree to our Terms of Use.