gradient « Plot « JFreeChart Q&A





2. Creating a Gradient Background for a CategoryPlot    jfree.org

You should override the fillBackground() method in the Plot class. Check if the backgroundPaint attribute is an instance of GradientPaint. If it is, it will have fixed coordinates for color1 and color2 - you probably don't want that, as you'll want the gradient to cover the whole background area. So create a new GradientPaint instance using the same color1 and color2 ...

3. XYPlot.setBackgroundPaint() with gradient (version 1.0.9)    jfree.org

Setting the backgroundPaint of a Plot to a diagonal GradientPaint (e.g. from (0,0) to (100,100)) does not result in a diagonal gradient being rendered. Instead, the gradient is always vertical or horizontal (depending on the plot orientation). When using the same gradient for the chart background, it is displayed as I want (diagonally). According to the javadoc, this is intentional. IMHO ...

4. XY-Plot: gradient background --> scale gradient    jfree.org

Some parts of JFreeChart supprt a GradientPaintTransformer which will transform one GradientPaint defined with potentially useless points to another GradientPaint with points that are more suited to fill the Rectangle or more generally Shape in question. Objects that support a GradientPaintTransformer are the BarRenderer and IntervalMarker classes. Unfortunately, the only supported Paint type is GradientPaint. The MultipleGradientPaint class and subclasses introduced ...