Jump to content

xmChart scaling issues


stanley

This topic is 7046 days old. Please don't post here. Open a new topic instead.

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

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

  • 2 months later...

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

Link to comment
Share on other sites

This topic is 7046 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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