Skip to content
Snippets Groups Projects
Commit cc76f6a6 authored by Tim Molter's avatar Tim Molter
Browse files

Issue #87 allow error bar color to match series color

parent ba53e6c1
No related branches found
No related tags found
No related merge requests found
......@@ -143,6 +143,7 @@ public class StyleManager {
// Error Bars ///////////////////////////////
private Color errorBarsColor;
private boolean isErrorBarsColorSeriesColor;
// Formatting ////////////////////////////////
private Locale locale;
......@@ -231,6 +232,7 @@ public class StyleManager {
// Error Bars ///////////////////////////////
errorBarsColor = theme.getErrorBarsColor();
isErrorBarsColorSeriesColor = theme.isErrorBarsColorSeriesColor();
// Formatting ////////////////////////////////
locale = Locale.getDefault();
......@@ -1045,7 +1047,7 @@ public class StyleManager {
/**
* set whether or no bars are filled with a solid color or empty.
*
*
* @param isBarFilled
*/
public void setBarFilled(boolean isBarFilled) {
......@@ -1092,6 +1094,21 @@ public class StyleManager {
return errorBarsColor;
}
/**
* Set true if the the error bar color should match the series color
*
* @return
*/
public void setErrorBarsColorSeriesColor(boolean isErrorBarsColorSeriesColor) {
this.isErrorBarsColorSeriesColor = isErrorBarsColorSeriesColor;
}
public boolean isErrorBarsColorSeriesColor() {
return isErrorBarsColorSeriesColor;
}
// Formatting ////////////////////////////////
/**
......
......@@ -236,7 +236,14 @@ public class PlotContentLineChart extends PlotContent {
if (errorBars != null) {
g.setColor(getChartPainter().getStyleManager().getErrorBarsColor());
// set error bar color
if (getChartPainter().getStyleManager().isErrorBarsColorSeriesColor()) {
g.setColor(series.getStrokeColor());
}
else {
g.setColor(getChartPainter().getStyleManager().getErrorBarsColor());
}
g.setStroke(errorBarStroke);
double topValue = 0.0;
......
......@@ -315,4 +315,9 @@ public class GGPlot2Theme implements Theme {
return ChartColor.getAWTColor(ChartColor.DARK_GREY);
}
@Override
public boolean isErrorBarsColorSeriesColor() {
return false;
}
}
......@@ -316,4 +316,9 @@ public class MatlabTheme implements Theme {
return ChartColor.getAWTColor(ChartColor.BLACK);
}
@Override
public boolean isErrorBarsColorSeriesColor() {
return false;
}
}
......@@ -132,4 +132,6 @@ public interface Theme {
public Color getErrorBarsColor();
public boolean isErrorBarsColorSeriesColor();
}
......@@ -315,4 +315,10 @@ public class XChartTheme implements Theme {
return ChartColor.getAWTColor(ChartColor.DARK_GREY);
}
@Override
public boolean isErrorBarsColorSeriesColor() {
return false;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment