Spider Label Disappears on Chart Resize

7 posts, 0 answers
  1. Charles Covell
    Charles Covell avatar
    11 posts
    Member since:
    Apr 2010

    Posted 04 Jan 2011 Link to this post

    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
  2. Evgeni "Zammy" Petrov
    Admin
    Evgeni "Zammy" Petrov avatar
    168 posts

    Posted 07 Jan 2011 Link to this post

    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
  3. Charles Covell
    Charles Covell avatar
    11 posts
    Member since:
    Apr 2010

    Posted 07 Jan 2011 Link to this post

    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
  4. Ves
    Admin
    Ves avatar
    2927 posts

    Posted 12 Jan 2011 Link to this post

    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>>
  5. Charles Covell
    Charles Covell avatar
    11 posts
    Member since:
    Apr 2010

    Posted 12 Jan 2011 Link to this post

    Thanks for looking into it.  Hopefully the issue will be resolved in an upcoming release.
  6. Charles Covell
    Charles Covell avatar
    11 posts
    Member since:
    Apr 2010

    Posted 31 Jan 2011 Link to this post

    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
  7. Diego
    Diego avatar
    1 posts
    Member since:
    Nov 2010

    Posted 03 Mar 2011 Link to this post

    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
Back to Top