Class TestForIssue585

java.lang.Object
org.knowm.xchart.standalone.issues.TestForIssue585

public class TestForIssue585 extends Object
Demonstrates issue #585 — a symmetric colormap definition produces an asymmetric legend.

The gradient legend bar for the Vertical layout has its LinearGradientPaint "start" point placed fontSize pixels above the actual bottom of the rectangle. This leaves a strip at the bottom that is always clamped to rangeColors[0] (the min colour), making the min-colour area visually larger than the max-colour area even when the colormap and data range are perfectly symmetric.

Two windows open side by side — one for each LegendPosition — so the asymmetry is visible in both orientations. The colourmap intentionally goes blue → dark → blue to make the off-centre midpoint obvious.

  • Constructor Details

    • TestForIssue585

      public TestForIssue585()
  • Method Details

    • main

      public static void main(String[] args)
    • getChartVertical

      public static HeatMapChart getChartVertical()
      Vertical legend — bug is visible here: blue band at the bottom is wider than at the top.
    • getChartHorizontal

      public static HeatMapChart getChartHorizontal()
      Horizontal legend — shown for comparison.
    • getChart

      public static HeatMapChart getChart()