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

Graph category axis labels not displaying correctly

8 Answers 146 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 2
Martin asked on 01 Oct 2014, 12:31 PM
Hi,

Ive got a graph which is very small but has a lot of bars on it, using a category scale. Obviously theres no way all the labels will fit so im trying to hide some.

From various forum posts ive seen that I should set the Label property on my category group to either the value i want or an empty string for the ones i want to hide. This part works but when the graph is rendered the labels are still too small and get cropped even though the labels next to them are blank.
See attached image.

Below is the expression im using on the CategoryGroup Label:
= IIf(Fields.Band = "8Hz" Or Fields.Band = "16Hz" Or Fields.Band = "31.5Hz" Or Fields.Band = "63Hz" Or Fields.Band = "125Hz" Or Fields.Band = "250Hz" Or Fields.Band = "500Hz" Or Fields.Band = "1kHz" Or Fields.Band = "2kHz" Or Fields.Band = "4kHz" Or Fields.Band = "8kHz" Or Fields.Band = "16kHz",
 Fields.Band, "")
I also tried Null instead of empty string but it didnt change anything.

Is there something I can change to get it to render the labels correctly? Or is there some other approach i should be using? I considered a numerical scale and using the step value to skip some labels but there doesnt seem to be a way to override what text is displayed in that case.

Thanks,
Martin

8 Answers, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 06 Oct 2014, 09:02 AM
Hello Martin,

The space for the axis labels will be preserved even if you set it to an empty string using the provided expression.
My suggestion in this scenario is to rotate the labels by 90 degrees using the LabelAngle property. You can also use a smaller font size for the labels which will save additional space.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Martin
Top achievements
Rank 2
answered on 06 Oct 2014, 02:10 PM
Hi Nasko,

Thanks for the suggestions.
They were already rotated so I tried out some different font sizes. Smaller fonts certainly help but ive gone as far as 6pt and it still doesnt quite fit, I also made the graph slightly larger by reducing some margins. I dont really want to go any smaller on the font as it wont fit well with the rest of the page as well as not being very readable.

Do you have any other suggestions?

Thanks,
Martin
0
Martin
Top achievements
Rank 2
answered on 07 Oct 2014, 03:12 PM
Hi Nasko,

I've done some more testing and it seems that the issue is just with the preview shown in a WPF ReportViewer control.

Both the printout and the pdf export show the labels without cropping. This is fine for now as this is ultimately what the users care about, although I expect some questions as to why it doesn't look the same.

Hopefully you can get a fix for this into a future release.
I'm now looking at other issues: DateTime axis scaling

Thanks again,
Martin
0
Nasko
Telerik team
answered on 09 Oct 2014, 10:44 AM
Hello Martin,

If you could attach a sample report which displays differently in the WPF Report Viewer and in the PDF/Printed document we would be glad to test it locally and investigate the described issue further.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Martin
Top achievements
Rank 2
answered on 09 Oct 2014, 03:24 PM
Hi Nasko,

Ive made a simple report with a single graph showing the behaviour. If i open this in my application using the WPF report viewer the labels crop each other, when i print or export the labels are shown correctly. Just to be clear on exactly what im seeing ive attached 2 screenshots.

Below file contains report class created in VS2013, exported trdx file and required data class.
ExampleReport.zip

Regards,
Martin
0
Nasko
Telerik team
answered on 14 Oct 2014, 12:32 PM
Hello Martin,

We managed to reproduce the described behavior locally using the provided sample. This issue is now logged in our system for improvement and will be addressed in a future release of Telerik Reporting.

Your Telerik points are updated to thank you for reporting the issue.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rick
Top achievements
Rank 2
Iron
answered on 11 Mar 2015, 03:26 PM
Nasko,

Has this issue been addressed? Do you anticipate the resolution in the next release?

Thank you.

-Rick
0
Nasko
Telerik team
answered on 16 Mar 2015, 01:12 PM
Hello Rick,

This issue has been fixed for the Q3 2014 SP1 release of Telerik Reporting:

"WPF Report Viewer
Fixed: Rotated Graph axis labels are cut off"

For more information, please refer to the Release History page.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
Martin
Top achievements
Rank 2
Answers by
Nasko
Telerik team
Martin
Top achievements
Rank 2
Rick
Top achievements
Rank 2
Iron
Share this question
or