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

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

10 Answers 154 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Carlos Serrano
Top achievements
Rank 1
Carlos Serrano asked on 30 Aug 2013, 04:35 PM
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.

10 Answers, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 04 Sep 2013, 07:21 AM
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 >>
0
Carlos Serrano
Top achievements
Rank 1
answered on 05 Sep 2013, 02:48 PM
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
0
Petar Marchev
Telerik team
answered on 10 Sep 2013, 07:42 AM
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 >>
0
Carlos Serrano
Top achievements
Rank 1
answered on 10 Sep 2013, 03:43 PM
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
0
Petar Marchev
Telerik team
answered on 11 Sep 2013, 08:34 AM
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 >>
0
Carlos Serrano
Top achievements
Rank 1
answered on 16 Sep 2013, 08:45 AM
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.
0
Petar Marchev
Telerik team
answered on 18 Sep 2013, 07:59 AM
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 >>
0
Carlos Serrano
Top achievements
Rank 1
answered on 19 Sep 2013, 07:55 AM
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.
0
Petar Marchev
Telerik team
answered on 23 Sep 2013, 07:25 AM
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 >>
0
Ahmed
Top achievements
Rank 1
answered on 18 Aug 2016, 01:56 PM

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

 

Ahmed

Tags
ChartView
Asked by
Carlos Serrano
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Carlos Serrano
Top achievements
Rank 1
Ahmed
Top achievements
Rank 1
Share this question
or