Skip to main content

Force Chart's X-Axis to show all Labels

Comments

8 comments

  • J. Reitter

    The only think I can think of immediately is to remove the graph "ChartWidth" setting and either leave it blank or set it to "50%". 

    Update: I just installed Logi Info 14.1 SP2 and it displays fine "as is". This might be part of the documented enhancements: 
    As a report developer, you can now customize your Chart Canvas to add gradients using CSS in styled mode, specify how many ticks are rendered on your chart axes, and enable tick auto rotation to prevent overlapping labels on your horizontal axis.

    0
  • Steve Jarvis

    Hi Johnny,

    I have noticed this in the past and have not found out how to force and would like to know.

    However, I just did a quick fix, change the orientation of the font by setting font angle usually 45 but have used 90, 270, etc. I have some long label names, some 25 chars and 30 fields so I also resize the font. I have also used horizontal bar charts or pie charts for many of these charts. I have not used charts as small as you have defined, mine are 450x600.

    Sorry I can not be more helpful.

    Cheers
    Steve

    0
  • VISUI

    Actually, if you look in the browser console, the labels are being rendered, except the span has an opacity of 0.


    #Chart1 .highcharts-xaxis-labels > span {
        opacity: 1 !important;
    }
     
     
    1
  • VISUI

    1
  • Steve Jarvis

    This causes an additional problem in my display if I resize the chart. Making it larger, dragging from the right, will display all labels. Resizing to the original then retains all labels, however, they now over lap each other. The chart does not refresh when shrinking it.

    I am the only one seeing this?

    0
  • Johnny Stevens

    Hey VISUI 

    Thanks again! The CSS is the ticket for getting all of the labels to appear.

    J. Reitter Steve Jarvis

    You guys are also correct that the visibility can be triggered based on the chart size and font size/angles. For some reason 14.1.x doesn't behave this way but 14.0 SPs 1, 2, and 3 do this auto-hide thing. I can't update all of my environments just to resolve this, so I'm going with the CSS edit that John Sweazen posted from VISUI

    Thanks all!!

    1
  • VISUI

    Johnny's original chart does not allow for resize.  This solution will work with a chart sized to 100% of its container and will display correctly based on the resizing of that container.

    IMO the Logi Chart Resizer provides a terrible user experience and should only be used in situations that require it.

    Charts should be sized to fill their container width, and the resize capability should be placed upon that container.

    The behavior Johnny is seeing with this chart should NEVER occur with a categorical X-Axis, because unlike a numerical or date sequence there is no way to infer what the missing label implies.  This might be a Logi or Highcharts bug.

    0
  • Johnny Stevens

    Hey VISUI

    The CSS is working to render all xAxis labels on the web output. However, the PDF and Excel exports are not including this change because they are using HighCharts getSVG() API which grabs the under-the-hood HighCharts code. So I need to find a way to force the X-Axis Labels to appear in HighCharts and not just via CSS. I've got this working-ish using the method I put in another post for the exports - https://devnet.logianalytics.com/hc/en-us/community/posts/6493612137111-New-option-for-live-export-of-Chart-to-PDF-Excel by adding the following line just after chart.getSVG() to force the replacement of all opacity=0 to opacity=1. I can't think of a use case or scenario in this report where I would want (or where the output would trigger) an opacity of '0', so this works for now, but it feels brute-forcish.

    svg = svg.replaceAll('opacity="0">','opacity="1">');

    Any other ideas for this?

    Thanks,
    Johnny

    0

Please sign in to leave a comment.