This is a migrated thread and some comments may be shown as answers.

Spider Label Disappears on Chart Resize

6 Answers 118 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Charles Covell
Top achievements
Rank 1
Charles Covell asked on 04 Jan 2011, 10:31 PM
Hi All,

I have a RadChart showing a PieDataSeries with the following labels and values:

Label 1    29.0
Label 2    11.0
Label 3    4.0
Label 4    2.0

The chart has Spider Labels and Smart Labelling enabled.  With the above Y-values, one of the labels (Label 2) appears on the bottom of the chart.  However, if the chart is resized to be too small (you can try this by resizing the window), Label 2 disappears.  It reappears if the chart is resized large enough.

This looks like a bug; if anyone has a workaround for it I'd be grateful!

Thanks,

Charley

6 Answers, 1 is accepted

Sort by
0
Evgeni "Zammy" Petrov
Telerik team
answered on 07 Jan 2011, 09:20 AM
Hello Charles Covell,

 Can you provide us with a screenshot ? 

I believe that this is normal behavior. When you have too little space the labels simply slide out of view. A possible workaround would be to use the PieSeriesDefinition.StartAngle property to rotate the pie, this might help the label to stay visible a bit more, but that might not work for any set of values.

Greetings,
Evgeni "Zammy" Petrov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Charles Covell
Top achievements
Rank 1
answered on 07 Jan 2011, 08:12 PM
Thanks for your reply.  The StartAngle solution is a good idea; unfortunately, in my case the chart comes from dynamically-generated data, so I really need a solution that will work in all cases.

I have been experimenting a little more with this issue, and I have some more accurate information for you.

Steps to reproduce the problem:

1. Create a simple Silverlight project with just a RadChart.  After initializing the MainPage, do the following:

Telerik.Windows.Controls.Charting.PieSeriesDefinition SeriesDef = new Telerik.Windows.Controls.Charting.PieSeriesDefinition();
SeriesDef.LabelSettings.SpiderModeEnabled = true;
SeriesDef.LabelSettings.ShowConnectors = true;
Telerik.Windows.Controls.Charting.DataSeries vals = new Telerik.Windows.Controls.Charting.DataSeries();
vals.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = 29, XValue = 0.0, XCategory = "First Category" });
vals.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = 11, XValue = 1.0, XCategory = "First Category" });
vals.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = 4, XValue = 2.0, XCategory = "Third Category" });
vals.Add(new Telerik.Windows.Controls.Charting.DataPoint() { YValue = 2, XValue = 2.0, XCategory = "Fourth Category" });
vals.Definition = SeriesDef;
MyChart.DefaultView.ChartArea.SmartLabelsEnabled = true;
MyChart.DefaultView.ChartArea.DataSeries.Clear();
MyChart.DefaultView.ChartArea.DataSeries.Add(vals);
SeriesDef.ItemLabelFormat = "#XCAT: #Y\n(#%{P1})";

2. Run the project and size your browser window to a content size of about 725x380.  All the labels show. (before.png)

3. Resize the window to be about twice as wide.  The height of the chart stays the same, but the bottom spider label disappears. (after.png)

To summarize:  If the window gets too wide (maintaining a constant height), labels start to get cut off.  Similarly, if the window gets too tall (maintaining a constant width), labels on the sides can start to get cut off, although they don't disappear suddenly like the bottom label; rather, they are partially cut off.

Many users on widescreen monitors experience this problem when the window is maximized.  What I would really like is a way to auto-size the chart so that all the labels show.  Is this possible?

Thanks in advance!

Charley
0
Ves
Telerik team
answered on 12 Jan 2011, 05:40 PM
Hello Charles,

Thank you for the detailed feedback. Indeed, I was able to reproduce the problem exactly as described and I must say the label should not disappear on expanding the control. I have logged it in our PITS here, so you can track its resolution. I have also updated your Telerik points.

Unfortunately, auto-sizing depending on the content would not be possible. The workaround for the time being would be to disable the spider labels. Please, accept our apologies for the inconvenience caused.

Best regards,
Ves
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Charles Covell
Top achievements
Rank 1
answered on 12 Jan 2011, 09:36 PM
Thanks for looking into it.  Hopefully the issue will be resolved in an upcoming release.
0
Charles Covell
Top achievements
Rank 1
answered on 01 Feb 2011, 12:58 AM
In case anyone else is having problems with this issue, here's an update/workaround.  It's actually pretty simple.

It seems that the issue occurs (at least in my example) when the pie chart's ChartArea width >= 1040 and when height <= 379.

Accordingly, we can solve the problem by setting the following:

MyChart.DefaultView.ChartArea.MaxWidth = 1039;
MyChart.DefaultView.ChartArea.MinHeight = 380;

This lets us to continue to use the cool Spider Label functionality of the RadCharts.

I hope this is helpful to other users.

Thanks,

Charley
0
Diego
Top achievements
Rank 1
answered on 03 Mar 2011, 02:42 PM
Hi folks, i suggest to work around use the property of PieSeriesDefinition.RadiusFactor= "[Value]", when reduce the size of pie area, the labels should be displayed.

Thanks!
Diego Cubissimo
Tags
Chart
Asked by
Charles Covell
Top achievements
Rank 1
Answers by
Evgeni "Zammy" Petrov
Telerik team
Charles Covell
Top achievements
Rank 1
Ves
Telerik team
Diego
Top achievements
Rank 1
Share this question
or