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

Chart CSS: -fx-text-fill does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • fx2.1
    • javafx
    • Windows 7 64-bit, Java 1.7.0_02 64-bit, JavaFX 2.1 b12 64-bit

      In the article "Styling Charts with CSS" http://docs.oracle.com/javafx/2.0/charts/css-styles.htm, it is indicated in example 8.1 and figure 8-2 that it's possible to change the color of some of the chart's labels by using CSS value such as :

      .chart {
          -fx-text-fill: red;
      }

      In the example this applies to the title, legend and horizontal label (and probably the vertical label, though it is not shown in the figure).
      However this has no effect on the chart in the end, unlike the examples in the tutorial.

      It is still possible to change the title and legend font by using more specific selectors like "chart-title" and "chart-legend-item" though.

      It seems impossible to style the vertical and horizontal labels except by using the following selector "chart .label", ie:

      .chart .label {
          -fx-text-fill: red;
      }

      This problem should be fixed or the tutorial should be revised to display the current behavior.

        1. Main.java
          2 kB
        2. Main.css
          0.2 kB

            Unassigned Unassigned
            fbouyajfx Fabrice Bouyé (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Imported: