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

uniform pie chart size

2 Answers 382 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Innis
Top achievements
Rank 1
Innis asked on 30 Nov 2017, 09:18 PM

I have a set of pie charts in a report. The size of the pie charts ends up being different based on the label sizes. a larger label will generate a smaller chart. a smaller label will generate a larger chart. How can I make the size of the charts uniform regardless of label size. 

I have tried to set the padding under the chart Style as well as the padding under the chart PlotAreaStyle. Setting the padding on the chart Style did decrease the size of the charts but it decreased them all by the same amount and they are still different sizes. 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Hristov
Telerik team
answered on 05 Dec 2017, 12:43 PM
Hi Innis,

The pie chart's available size depends on the size of the labels and changes dynamically, but the "pie" radius can be controlled through the Size property of the RadialAxis in graph's coordinate system. The property should be set to a string that represents a valid Unit, i.e. "5cm" or "100px", etc.

Please note that if the graph size is not large enough to accommodate the pie chart and its labels, the labels might be cut off.

Regards,
Ivan Hristov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
minh
Top achievements
Rank 2
Iron
Iron
Iron
commented on 06 Jan 2022, 04:25 AM

Hi,

I have exactly the same behaviour and when the graph size is not enough, the labels are cut off.

Do you have any solution to resolve this labels cut-off problem? For example: do a wrap text in the label, is this possible?

Ivan Hristov
Telerik team
commented on 07 Jan 2022, 10:09 AM

Hello Minh,

The Graph item doesn't automatically resize itself, because every item tries to keep its design-time size. So when there's no space for the labels, they're being overlapped or cut-off.

Currently there's no automatic adjustment of the data point labels' position or contents. However, you can consider applying some text transformation on longer labels, for example, if they are longer than 5 characters, replace the spaces with new line characters to make them wrap. In this case the expression would look like this (assuming the data point labels use Fields.Type to show their text):

= IIF(Len(Fields.Type) > 5, 
Replace(Fields.Type, ' ', '
'), Fields.Type)

 

Hope this helps.

Regards,
Ivan Hristov
Telerik Reporting

0
Innis
Top achievements
Rank 1
answered on 06 Dec 2017, 03:18 PM

That solved my problem. Thank you for your help. 

 

Tags
General Discussions
Asked by
Innis
Top achievements
Rank 1
Answers by
Ivan Hristov
Telerik team
Innis
Top achievements
Rank 1
Share this question
or