Skip to content

Commit

Permalink
Fix filling bar charts by data point
Browse files Browse the repository at this point in the history
When using a HistogramRenderer with renderer.setDrawBars(true) and renderer.setPolyLineStyle(LineStyle.NONE), setting a fill colour on an individual data point per dataset.addDataStyle(index, "fillColor=cyan;") was not working.

The HistogramRenderer unit tests were already attempting to test this feature, but within the test environment the data point styles weren't being provided to the renderer correctly. This has also been addressed.

I've updated the reference screenshot accordingly, however I may need your guidance on whether that's appropriate because there are a couple of significant issues from me running on macOS:

- The fonts are rendered quite differently to the original reference snapshot
- I believe my localisation settings are causing the y-axis numbers to be formatted differently, UK style (0.50) instead of European (0,500).

I can see that FuzzyTestImageUtils.compareAndWriteReference does have some tolerance to differences, however I expect in this case I'm exceeding the threshold, in which case I might need your assistance to generate another reference snapshot which is closer and more meaningful.
  • Loading branch information
edkennard authored and wirew0rm committed Mar 21, 2022
1 parent 57b671b commit 9056cd1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ protected void drawBars(final GraphicsContext gc, final List<DataSet> dataSets,
gc.save();
DefaultRenderColorScheme.setMarkerScheme(gc, dataPointStyle, lindex);
DefaultRenderColorScheme.setLineScheme(gc, dataPointStyle, lindex);
DefaultRenderColorScheme.setFillScheme(gc, dataPointStyle, lindex);
DefaultRenderColorScheme.setGraphicsContextAttributes(gc, dataPointStyle);
}
double topRadius = isRoundedCorner() ? Math.max(0, Math.min(getRoundedCornerRadius(), 0.5 * binWidth)) : 0.0;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ public ErrorType getErrorType(final int dimIndex) {
return super.getErrorType(dimIndex);
}

@Override
public final String getStyle(final int index) { // NOPMD by steinhagen on 08/06/19 10:12
return null;
}

@Override
public D update() {
lock().writeLockGuard(() -> {
Expand Down

0 comments on commit 9056cd1

Please sign in to comment.