Graph category axis labels not displaying correctly

9 posts, 0 answers
  1. Martin
    Martin avatar
    20 posts
    Member since:
    Apr 2009

    Posted 01 Oct 2014 Link to this post

    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
  2. Nasko
    Admin
    Nasko avatar
    1067 posts

    Posted 06 Oct 2014 Link to this post

    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.

     
  3. Martin
    Martin avatar
    20 posts
    Member since:
    Apr 2009

    Posted 06 Oct 2014 in reply to Nasko Link to this post

    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
  4. Martin
    Martin avatar
    20 posts
    Member since:
    Apr 2009

    Posted 07 Oct 2014 Link to this post

    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
  5. Nasko
    Admin
    Nasko avatar
    1067 posts

    Posted 09 Oct 2014 Link to this post

    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.

     
  6. Martin
    Martin avatar
    20 posts
    Member since:
    Apr 2009

    Posted 09 Oct 2014 in reply to Nasko Link to this post

    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
  7. Nasko
    Admin
    Nasko avatar
    1067 posts

    Posted 14 Oct 2014 Link to this post

    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.

     
  8. Rick
    Rick avatar
    5 posts
    Member since:
    Aug 2012

    Posted 11 Mar 2015 in reply to Nasko Link to this post

    Nasko,

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

    Thank you.

    -Rick
  9. Nasko
    Admin
    Nasko avatar
    1067 posts

    Posted 16 Mar 2015 Link to this post

    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.

     
Back to Top