Repository navigation
Conversation
CategoryStyler and HorizontalBarStyler add setBarFillGradientEnabled, initialized false so existing charts keep the flat fill. When the flag is on, PlotContent_Category and PlotContent_HorizontalBar fill each bar with a non-cyclic GradientPaint from the series fill at the segment base to fill.brighter() at the value end; negative bars reverse those ends, coincident endpoints stay flat, and the Graphics2D paint from before the gradient is restored. Legend_Marker uses that upward positive-bar gradient only for a CategorySeries rendered as Bar, and Legend_HorizontalBar uses a left-to-right positive-bar gradient; every other swatch stays a flat fill. BarChart14 turns the option on for positive and negative category bars, and BarFillGradientTest checks rendered pixels for direction, stacking, clipping, log axes, legends, non-bar series, and alpha. Fixes knowm#730
Open
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category bar charts and horizontal bar charts paint each bar, and the matching legend swatch, with one flat series fill color. A caller has no styler option that fades that color from the bar base to a brighter color at the value.
Verification
The xchart module test-compile finished and the reactor reported BUILD SUCCESS.
Summary
CategoryStyler and HorizontalBarStyler add setBarFillGradientEnabled, initialized false so existing charts keep the flat fill. When the flag is on, PlotContent_Category and PlotContent_HorizontalBar fill each bar with a non-cyclic GradientPaint from the series fill at the segment base to fill.brighter() at the value end; negative bars reverse those ends, coincident endpoints stay flat, and the Graphics2D paint from before the gradient is restored. Legend_Marker uses that upward positive-bar gradient only for a CategorySeries rendered as Bar, and Legend_HorizontalBar uses a left-to-right positive-bar gradient; every other swatch stays a flat fill. BarChart14 turns the option on for positive and negative category bars, and BarFillGradientTest checks rendered pixels for direction, stacking, clipping, log axes, legends, non-bar series, and alpha.
Fixes #730