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

Charts - Labels/Legends don't have readable colors, when background is dark.

    XMLWordPrintable

    Details

      Description

      I discovered some minor bugs, when playing with charts and using dark background colors.

      In the caspian.css .root class, I changed the following values to a dark color:

      -fx-base: #444444;
      -fx-background: #333333;
      -fx-control-inner-background: #333333;


      Then some parts of my charts weren't displayed in a readable manner.

      1. The Labels of the pie-chart (around the chart, not in the legend), were still black.
      2. The Legends had white (or bright) background, but their text was also white, therefore unreadable, because there is no ladder applied to the background.

      I made the following two changes to my stylesheet, which fix both problems and I suggest to integrate it in the caspian.css:

      .chart-legend {
          -fx-background-color: ladder(-fx-background, derive(-fx-box-border, -10%) 50%, derive(-fx-box-border, 10%) 51%), ladder(-fx-background, derive(-fx-control-inner-background, 5%) 50%, derive(-fx-control-inner-background, -5%) 51%);
      }

      .chart-pie-label {
          -fx-fill: -fx-text-base-color;
      }

      Of course you can choose other colors/ladders for the chart-legend.

        Attachments

          Activity

            People

            Assignee:
            jgiles Jonathan Giles
            Reporter:
            cschudtjfx Christian Schudt (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: