Linear categorical chart, no Y axis: first label on X axis clipped, first and last point values clipped

11 posts, 0 answers
  1. Carlos Serrano
    Carlos Serrano avatar
    12 posts
    Member since:
    May 2010

    Posted 30 Aug 2013 Link to this post

    Hello,

    When I create a categorical RadChartView with a LineSeries, and I only show the X axis (the Y axis has its Visibility set to Collapsed), the first label in the X axis is clipped.

    Also (and this is independent from the fact that the Y axis is hidden), the first and last point labels are clipped as well. Please look at the attached file for a picture of the issue.

    Is there any solution to this?

    Thanks,
    Carlos.
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 04 Sep 2013 Link to this post

    Hello Carlos,

    the first label in the X axis is clipped
    This has already been fixed with the latest SP (2013 Q2 SP).

    first and last point labels are clipped
    This is due to the fact that by default the series clip all their content to the plot area. You can set the ClipToPlotArea property of the series to false to avoid this. Give it a try and let us know how it goes.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Carlos Serrano
    Carlos Serrano avatar
    12 posts
    Member since:
    May 2010

    Posted 05 Sep 2013 Link to this post

    Hello Petar,

    Thanks for this. I confirm this is no longer a problem with both the ClipToPlotArea option and the Q2 2013 SP1 release.

    However, I am still getting some clipping of labels, this time in pie charts (see the attached picture). In that chart, I gave the labels a margin of "-4,0,0,0" so that they would not sit within the sections of the pie, but outside, just like this is done in your example (at http://demos.telerik.com/silverlight/#ChartView/Palettes).

    When the drawing area is roughly square, there is no clipping, this only happens when the drawing area is rectangular (the height is > width).

    Any idea?

    Thanks!
    Carlos
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 10 Sep 2013 Link to this post

    Hi Carlos,

    The chart tries to respect the RadiusFactor value of the PieSeries which makes the actual pie as large as it is. Later the labels are being positioned. However, currently there is no smart-labels feature and the chart does not check to see if a label will be clipped. As a result - some labels get clipped.

    You can try to change the Margin property and update the RadiusFactor (to a smaller value). You can also not set a LabelDefinition at all and leave it at its default behavior. Alternatively you can use the Strategy property of the ChartSeriesLabelDefinition and implement a custom strategy. I hope this helps.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  6. Carlos Serrano
    Carlos Serrano avatar
    12 posts
    Member since:
    May 2010

    Posted 10 Sep 2013 Link to this post

    Hello Petar,

    Thanks for the tip. I however tried a number of things, and in particular overriding GetLabelLayoutSlot in my own subclass of ChartSeriesLabelStrategy (since my series is dynamic), but whatever I do the values are clipped.

    Again, what I want to achieve is what is shown in the previous picture, which is to have the labels outside of the pie.

    Would you have an example with a custom label strategy that works in all cases?

    Thanks in advance,
    Carlos
  7. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 11 Sep 2013 Link to this post

    Hello Carlos,

    have the labels outside of the pie
    If you want the labels to spread outside the chart's boundaries you can simply set the ClipToPlotArea property of the series to false and ClipToBounds property of the chart to false.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  8. Carlos Serrano
    Carlos Serrano avatar
    12 posts
    Member since:
    May 2010

    Posted 16 Sep 2013 Link to this post

    Hello Petar,

    This is not exactly it. I want the labels to be completely outside of the pie, never inside, and the pie itself to be resized properly to give the labels enough space.

    In the attached picture, I gave the labels a margin of "-4,0,0,0" (for them to reside outside of the pies), I set the series' ClipToPlotArea property to false, and the ClipToBounds property of the chart to false. This time, I do not get clipping on the labels, but they get drawn outside of the bounds of the controls itself, which is not what I want either.

    It seemed to me that your idea of using the ChartSeriesLabelStrategy was the way to go, but as I wrote in my previous post, I was not able to make this work since the labels were clipped no matter what, whereas I want the size of the pie to be dependent on what is left once the labels (outside of it) have been laid out.

    Would you have any more suggestions, or code sample?

    Thanks,
    Carlos.
  9. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 18 Sep 2013 Link to this post

    Hi Carlos,

    I want the labels to be completely outside of the pie, never inside, and the pie itself to be resized properly to give the labels enough space.
    The RadPieChart respects the RadiusFactor of the series and this is the reason that the pie has constant size, disregarding the labels' sizes. The size of the pie depends solely on the radius factor and size of the chart. 

    I can suggest that you decrease the RadiusFactor which will leave more space for the labels.

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  10. Carlos Serrano
    Carlos Serrano avatar
    12 posts
    Member since:
    May 2010

    Posted 19 Sep 2013 Link to this post

    Hello Petar,

    Your proposal only works if the series I have is completely static. In my case, I do not know in advance what the labels will be, or what the values will be. So even if I set a predefined RadiusFactor, it will work with one particular series but not with another...

    Do you have any other suggestion?

    Thanks,
    Carlos.
  11. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 23 Sep 2013 Link to this post

    Hi Carlos,

    Perhaps you can leave the pie chart with no labels and use a legend instead. Alternatively you can use horizontal bar chart instead of the pie chart.  

    Regards,
    Petar Marchev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  12. Ahmed
    Ahmed avatar
    3 posts
    Member since:
    Jan 2014

    Posted 18 Aug in reply to Carlos Serrano Link to this post

    Set ClipToBounds to False in the Chart, and give your chart a Margin.

     

    Ahmed

Back to Top
DevCraft banner