Jump to content
Software FX Community

Legend box not scaled with chart


User (Legacy)

Recommended Posts

I have a simple pie chart docked to fill a winform and would like to 

display the legend box. However, I've noticed that the legend box isn't

rescaled together with the pie chart - when the winform is made smaller,

the legend stays full-size and if the form is made too small the chart

isn't visible and the legend is clipped.

Is this the expected behavior? If so, is it possible to relocate or

separate the chart from the legend, so I can show just the legend below

the chart?

Thanks for any ideas!

Bar

*** code ***

Chart myChart = new SoftwareFX.ChartFX.Lite.Chart();

myChart.DataType[0] = DataType.Label;

myChart.DataType[1] = DataType.Value;

myChart.DataType[2] = DataType.NotUsed;

myChart.Gallery = Gallery.Pie;

myChart.Chart3D = true;

myChart.Size = new System.Drawing.Size(500,500);

myChart.DataSource = GenerateDataTable();

myChart.LegendBox = true;

*** code ***

Link to comment
Share on other sites

If the legend is AutoSize (default). It is as small as it can be from the

beginning, so reducing the chart will cause no change in the size of the

legend box. The legend box size is always the MINIMUM possible.

If you are setting the size of the legend box through code, then it will be

fixed to whatever you se it.

If I'm misunderstanding your question, please post a screenshot of "the

problem".

--

FP

Software FX

Link to comment
Share on other sites

Attached is a screenshot.  Since the data is generated at runtime, 

sometimes the number of data items is larger than I would normally put

in a pie chart (this example has around 40). Still, I can't have the

labels crowding out the graph!

Also, this post was _supposed_ to be sent to the .lite list. Could it

be that the light version doesn't allow legend box resizing by code?

Thanks!

SoftwareFX Support wrote:

> If the legend is AutoSize (default). It is as small as it can be from the

> beginning, so reducing the chart will cause no change in the size of the

> legend box. The legend box size is always the MINIMUM possible.

>

> If you are setting the size of the legend box through code, then it will be

> fixed to whatever you se it.

>

> If I'm misunderstanding your question, please post a screenshot of "the

> problem".

>

Link to comment
Share on other sites

Attached is a screenshot.  Since the data is generated at runtime, 

sometimes the number of data items is larger than I would normally put

in a pie chart (this example has around 40). Still, I can't have the

labels crowding out the graph!

Also, this post was _supposed_ to be sent to the .lite list. Could it

be that the light version doesn't allow legend box resizing by code?

Thanks!

SoftwareFX Support wrote:

> If the legend is AutoSize (default). It is as small as it can be from the

> beginning, so reducing the chart will cause no change in the size of the

> legend box. The legend box size is always the MINIMUM possible.

>

> If you are setting the size of the legend box through code, then it will be

> fixed to whatever you se it.

>

> If I'm misunderstanding your question, please post a screenshot of "the

> problem".

>

chart.bmp

Link to comment
Share on other sites

You have so many labels that the is no way to reduce the legend box.

As I said before the legend box will display as small as possible but it

will always display all of its contents.

In this case the legend box IS displaying as small as possible the thing is

that minimum size imposed by your data is big.

How did you expect the legend to do ? display less labels ? which ?

--

FP

Software FX

post-2107-13922378401011_thumb.gif

Link to comment
Share on other sites

I realize that there are a lot of labels!  As I said earlier, the data

is generated at runtime, and in rare cases there will be a lot of them.

I was hoping to control the scale of the labels, or find a way that

the the entire chart, pie and labels together, is scaled to the same

proportions.

Given that the labels aren't scaled at all, I have devised a workaround

(but am still looking for a better solution). Taking into account the

height and width of the form or the printer settings, I've determined

how to obtain a decent proportion between pie chart and labels based on

how many labels exist by regulating the size of the chart in code. Then

I convert the chart into an image, and finally scale the image back to

the dimensions I need. It roundabout, but it's the only way I found to

manage the occasional situation where there are a lot of labels.

SoftwareFX Support wrote:

> You have so many labels that the is no way to reduce the legend box.

>

> As I said before the legend box will display as small as possible but it

> will always display all of its contents.

>

> In this case the legend box IS displaying as small as possible the thing is

> that minimum size imposed by your data is big.

>

> How did you expect the legend to do ? display less labels ? which ?

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...