Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8122228

[Charts] In creating a vertical bar chart, the call to setTickLabelRotation() on the x-axis seems to have no effect

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 7u45
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Environment:

      Windows 7, JRE 1.7.0_45, JavaFx 2.2.45-b18

      Description

      In creating a bar chart, the axis API has the method setTickLabelRotation() to set the orientation of labels on the bars. In my attempt to use this on the x-axis in a vertical bar chart, this call seems to be ignored:
              xAxis.setTickLabelRotation(90);

      Its been observed that the orientation of the bar labels along the x-axis is determined entirely by the size of the display, and can change from horizontal to vertical or vice-a-versa as the display is re-sized. The value set by the call to setTickLabelRotation() seems to be ignored.

      Moreover, depending upon the display size, the labels may get rendered horizontally, but only for alternate bars. This is a problem in my particular situation, which is what prompted me to use setTickLabelRotation().

      I used the example code from http://docs.oracle.com/javafx/2/charts/bar-chart.htm to recreate the case I describe. Even this tutorial suggests using setTickLabelRotation() to set the orientation of of the tick labels (except its use is shown in a horizontal bar chart, as opposed to the vertical bar chart that is of interest to me).

      There ought to be a way to ensure that the bar labels are always displayed, and enforcing the rotation may be one way to do so.

        Attachments

          Activity

            People

            • Assignee:
              jgiles Jonathan Giles
              Reporter:
              duke J. Duke (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: