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

Issue #130 - allow bars to touch bottom at the X-Axis.

parent e85d0b8d
Branches
No related tags found
No related merge requests found
Showing
with 69 additions and 77 deletions
...@@ -94,8 +94,8 @@ public class AreaLineChart03 implements ExampleChart { ...@@ -94,8 +94,8 @@ public class AreaLineChart03 implements ExampleChart {
chart.getStyler().setYAxisLabelAlignment(Styler.TextAlignment.Right); chart.getStyler().setYAxisLabelAlignment(Styler.TextAlignment.Right);
chart.getStyler().setYAxisDecimalPattern("$ #,###.##"); chart.getStyler().setYAxisDecimalPattern("$ #,###.##");
chart.getStyler().setPlotPadding(0); chart.getStyler().setPlotMargin(0);
chart.getStyler().setAxisTickSpacePercentage(.95); chart.getStyler().setPlotContentSize(.95);
// chart.getStyleManager().setYAxisMax(1620725 * 1.15); // We want to ensure there is a % of padding on the top of the chart // chart.getStyleManager().setYAxisMax(1620725 * 1.15); // We want to ensure there is a % of padding on the top of the chart
return chart; return chart;
} }
......
...@@ -34,6 +34,7 @@ import org.knowm.xchart.internal.style.Styler.LegendPosition; ...@@ -34,6 +34,7 @@ import org.knowm.xchart.internal.style.Styler.LegendPosition;
* <li>All positive values * <li>All positive values
* <li>Single series * <li>Single series
* <li>Place legend at Inside-NW position * <li>Place legend at Inside-NW position
* <li>Bars touch X-Axis
*/ */
public class BarChart01 implements ExampleChart { public class BarChart01 implements ExampleChart {
...@@ -53,6 +54,7 @@ public class BarChart01 implements ExampleChart { ...@@ -53,6 +54,7 @@ public class BarChart01 implements ExampleChart {
// Customize Chart // Customize Chart
chart.getStyler().setLegendPosition(LegendPosition.InsideNW); chart.getStyler().setLegendPosition(LegendPosition.InsideNW);
chart.getStyler().setPlotContentSize(1.0);
return chart; return chart;
} }
......
...@@ -90,7 +90,7 @@ public class LineChart03 implements ExampleChart { ...@@ -90,7 +90,7 @@ public class LineChart03 implements ExampleChart {
chart.getStyler().setAxisTickMarkLength(15); chart.getStyler().setAxisTickMarkLength(15);
chart.getStyler().setPlotPadding(20); chart.getStyler().setPlotMargin(20);
chart.getStyler().setChartTitleFont(new Font(Font.MONOSPACED, Font.BOLD, 24)); chart.getStyler().setChartTitleFont(new Font(Font.MONOSPACED, Font.BOLD, 24));
chart.getStyler().setLegendFont(new Font(Font.SERIF, Font.PLAIN, 18)); chart.getStyler().setLegendFont(new Font(Font.SERIF, Font.PLAIN, 18));
......
...@@ -99,7 +99,6 @@ public class LineChart07 implements ExampleChart { ...@@ -99,7 +99,6 @@ public class LineChart07 implements ExampleChart {
series.setMarker(SeriesMarkers.NONE); series.setMarker(SeriesMarkers.NONE);
// series.setChartCategorySeriesRenderStyle(ChartCategorySeriesRenderStyle.Line); // series.setChartCategorySeriesRenderStyle(ChartCategorySeriesRenderStyle.Line);
} }
chart.getStyler().setYAxisLogarithmic(true);
return chart; return chart;
} }
......
...@@ -55,7 +55,7 @@ public class PieChart03 implements ExampleChart<Chart_Pie> { ...@@ -55,7 +55,7 @@ public class PieChart03 implements ExampleChart<Chart_Pie> {
chart.getStyler().setLegendVisible(false); chart.getStyler().setLegendVisible(false);
chart.getStyler().setAnnotationType(AnnotationType.LabelAndPercentage); chart.getStyler().setAnnotationType(AnnotationType.LabelAndPercentage);
chart.getStyler().setAnnotationDistance(1.15); chart.getStyler().setAnnotationDistance(1.15);
chart.getStyler().setPieSize(.7); chart.getStyler().setPlotContentSize(.7);
return chart; return chart;
} }
......
...@@ -34,7 +34,6 @@ public class Styler_Pie extends Styler { ...@@ -34,7 +34,6 @@ public class Styler_Pie extends Styler {
Percentage, Label, LabelAndPercentage Percentage, Label, LabelAndPercentage
} }
private double pieSize;
private boolean isCircular; private boolean isCircular;
private double startAngleInDegrees; private double startAngleInDegrees;
private Font annotationFont; private Font annotationFont;
...@@ -54,7 +53,6 @@ public class Styler_Pie extends Styler { ...@@ -54,7 +53,6 @@ public class Styler_Pie extends Styler {
protected void setAllStyles() { protected void setAllStyles() {
chartPieSeriesRenderStyle = ChartPieSeriesRenderStyle.Pie; // set default to pie, donut may be a future one chartPieSeriesRenderStyle = ChartPieSeriesRenderStyle.Pie; // set default to pie, donut may be a future one
pieSize = theme.getPieSize();
isCircular = theme.isCircular(); isCircular = theme.isCircular();
annotationFont = theme.getPieFont(); annotationFont = theme.getPieFont();
annotationDistance = theme.getAnnotationDistance(); annotationDistance = theme.getAnnotationDistance();
...@@ -76,21 +74,6 @@ public class Styler_Pie extends Styler { ...@@ -76,21 +74,6 @@ public class Styler_Pie extends Styler {
this.chartPieSeriesRenderStyle = chartPieSeriesRenderStyle; this.chartPieSeriesRenderStyle = chartPieSeriesRenderStyle;
} }
public double getPieSize() {
return pieSize;
}
/**
* Sets the amount of space that the pie chart fills. Full fill is 100%, i.e. 1.0
*
* @param pieSize
*/
public void setPieSize(double pieSize) {
this.pieSize = pieSize;
}
public boolean isCircular() { public boolean isCircular() {
return isCircular; return isCircular;
......
...@@ -167,13 +167,13 @@ public class Axis<ST extends Styler_AxesChart, S extends Series> implements Char ...@@ -167,13 +167,13 @@ public class Axis<ST extends Styler_AxesChart, S extends Series> implements Char
- 2 * chart.getStyler().getChartPadding() - 2 * chart.getStyler().getChartPadding()
- (chart.getStyler().isYAxisTicksVisible() ? (chart.getStyler().getPlotPadding()) : 0) - (chart.getStyler().isYAxisTicksVisible() ? (chart.getStyler().getPlotMargin()) : 0)
- (chart.getStyler().getLegendPosition() == LegendPosition.OutsideE && chart.getStyler().isLegendVisible() ? chart.getStyler().getChartPadding() : 0) - (chart.getStyler().getLegendPosition() == LegendPosition.OutsideE && chart.getStyler().isLegendVisible() ? chart.getStyler().getChartPadding() : 0)
; ;
height = chart.getHeight() - yOffset - chart.getXAxis().getXAxisHeightHint(approximateXAxisWidth) - chart.getStyler().getPlotPadding() - chart.getStyler().getChartPadding(); height = chart.getHeight() - yOffset - chart.getXAxis().getXAxisHeightHint(approximateXAxisWidth) - chart.getStyler().getPlotMargin() - chart.getStyler().getChartPadding();
width = getYAxisWidthHint(height); width = getYAxisWidthHint(height);
// System.out.println("width after: " + width); // System.out.println("width after: " + width);
...@@ -208,8 +208,8 @@ public class Axis<ST extends Styler_AxesChart, S extends Series> implements Char ...@@ -208,8 +208,8 @@ public class Axis<ST extends Styler_AxesChart, S extends Series> implements Char
// calculate paint zone // calculate paint zone
// |____________________| // |____________________|
double xOffset = chart.getYAxis().getBounds().getWidth() + (chart.getStyler().isYAxisTicksVisible() ? chart.getStyler().getPlotPadding() : 0) + chart.getStyler().getChartPadding(); double xOffset = chart.getYAxis().getBounds().getWidth() + (chart.getStyler().isYAxisTicksVisible() ? chart.getStyler().getPlotMargin() : 0) + chart.getStyler().getChartPadding();
double yOffset = chart.getYAxis().getBounds().getY() + chart.getYAxis().getBounds().getHeight() + chart.getStyler().getPlotPadding(); double yOffset = chart.getYAxis().getBounds().getY() + chart.getYAxis().getBounds().getHeight() + chart.getStyler().getPlotMargin();
double width = double width =
...@@ -221,7 +221,7 @@ public class Axis<ST extends Styler_AxesChart, S extends Series> implements Char ...@@ -221,7 +221,7 @@ public class Axis<ST extends Styler_AxesChart, S extends Series> implements Char
- 2 * chart.getStyler().getChartPadding() - 2 * chart.getStyler().getChartPadding()
- (chart.getStyler().isYAxisTicksVisible() ? (chart.getStyler().getPlotPadding()) : 0) - (chart.getStyler().isYAxisTicksVisible() ? (chart.getStyler().getPlotMargin()) : 0)
- (chart.getStyler().getLegendPosition() == LegendPosition.OutsideE && chart.getStyler().isLegendVisible() ? chart.getStyler().getChartPadding() : 0) - (chart.getStyler().getLegendPosition() == LegendPosition.OutsideE && chart.getStyler().isLegendVisible() ? chart.getStyler().getChartPadding() : 0)
...@@ -230,7 +230,7 @@ public class Axis<ST extends Styler_AxesChart, S extends Series> implements Char ...@@ -230,7 +230,7 @@ public class Axis<ST extends Styler_AxesChart, S extends Series> implements Char
// double height = this.getXAxisHeightHint(width); // double height = this.getXAxisHeightHint(width);
// System.out.println("height: " + height); // System.out.println("height: " + height);
// the Y-Axis was already draw at this point so we know how much vertical room is left for the X-Axis // the Y-Axis was already draw at this point so we know how much vertical room is left for the X-Axis
double height = chart.getHeight() - chart.getYAxis().getBounds().getY() - chart.getYAxis().getBounds().getHeight() - chart.getStyler().getChartPadding() - chart.getStyler().getPlotPadding(); double height = chart.getHeight() - chart.getYAxis().getBounds().getY() - chart.getYAxis().getBounds().getHeight() - chart.getStyler().getChartPadding() - chart.getStyler().getPlotMargin();
// System.out.println("height2: " + height2); // System.out.println("height2: " + height2);
Rectangle2D xAxisRectangle = new Rectangle2D.Double(xOffset, yOffset, width, height); Rectangle2D xAxisRectangle = new Rectangle2D.Double(xOffset, yOffset, width, height);
......
...@@ -52,7 +52,7 @@ public class AxisTickCalculator_Category extends AxisTickCalculator_ { ...@@ -52,7 +52,7 @@ public class AxisTickCalculator_Category extends AxisTickCalculator_ {
private void calculate(List<?> categories, AxisDataType axisType) { private void calculate(List<?> categories, AxisDataType axisType) {
// tick space - a percentage of the working space available for ticks // tick space - a percentage of the working space available for ticks
int tickSpace = (int) (styler.getAxisTickSpacePercentage() * workingSpace); // in plot space int tickSpace = (int) (styler.getPlotContentSize() * workingSpace); // in plot space
// where the tick should begin in the working space in pixels // where the tick should begin in the working space in pixels
double margin = Utils.getTickStartOffset(workingSpace, tickSpace); double margin = Utils.getTickStartOffset(workingSpace, tickSpace);
......
...@@ -118,7 +118,7 @@ public class AxisTickCalculator_Date extends AxisTickCalculator_ { ...@@ -118,7 +118,7 @@ public class AxisTickCalculator_Date extends AxisTickCalculator_ {
private void calculate() { private void calculate() {
// tick space - a percentage of the working space available for ticks // tick space - a percentage of the working space available for ticks
double tickSpace = styler.getAxisTickSpacePercentage() * workingSpace; // in plot space double tickSpace = styler.getPlotContentSize() * workingSpace; // in plot space
// this prevents an infinite loop when the plot gets sized really small. // this prevents an infinite loop when the plot gets sized really small.
if (tickSpace < styler.getXAxisTickMarkSpacingHint()) { if (tickSpace < styler.getXAxisTickMarkSpacingHint()) {
......
...@@ -57,7 +57,7 @@ public class AxisTickCalculator_Logarithmic extends AxisTickCalculator_ { ...@@ -57,7 +57,7 @@ public class AxisTickCalculator_Logarithmic extends AxisTickCalculator_ {
} }
// tick space - a percentage of the working space available for ticks // tick space - a percentage of the working space available for ticks
double tickSpace = styler.getAxisTickSpacePercentage() * workingSpace; // in plot space double tickSpace = styler.getPlotContentSize() * workingSpace; // in plot space
// this prevents an infinite loop when the plot gets sized really small. // this prevents an infinite loop when the plot gets sized really small.
if (tickSpace < styler.getXAxisTickMarkSpacingHint()) { if (tickSpace < styler.getXAxisTickMarkSpacingHint()) {
......
...@@ -58,7 +58,7 @@ public class AxisTickCalculator_Number extends AxisTickCalculator_ { ...@@ -58,7 +58,7 @@ public class AxisTickCalculator_Number extends AxisTickCalculator_ {
} }
// tick space - a percentage of the working space available for ticks // tick space - a percentage of the working space available for ticks
double tickSpace = styler.getAxisTickSpacePercentage() * workingSpace; // in plot space double tickSpace = styler.getPlotContentSize() * workingSpace; // in plot space
// this prevents an infinite loop when the plot gets sized really small. // this prevents an infinite loop when the plot gets sized really small.
if (tickSpace < styler.getXAxisTickMarkSpacingHint()) { if (tickSpace < styler.getXAxisTickMarkSpacingHint()) {
......
...@@ -67,11 +67,11 @@ public class PlotContent_Category_Bar<ST extends Styler, S extends Series> exten ...@@ -67,11 +67,11 @@ public class PlotContent_Category_Bar<ST extends Styler, S extends Series> exten
g.setClip(bounds.createIntersection(rectangle)); g.setClip(bounds.createIntersection(rectangle));
// X-Axis // X-Axis
double xTickSpace = stylerCategory.getAxisTickSpacePercentage() * bounds.getWidth(); double xTickSpace = stylerCategory.getPlotContentSize() * bounds.getWidth();
double xLeftMargin = Utils.getTickStartOffset(bounds.getWidth(), xTickSpace); double xLeftMargin = Utils.getTickStartOffset(bounds.getWidth(), xTickSpace);
// Y-Axis // Y-Axis
double yTickSpace = stylerCategory.getAxisTickSpacePercentage() * bounds.getHeight(); double yTickSpace = stylerCategory.getPlotContentSize() * bounds.getHeight();
double yTopMargin = Utils.getTickStartOffset(bounds.getHeight(), yTickSpace); double yTopMargin = Utils.getTickStartOffset(bounds.getHeight(), yTickSpace);
Map<String, Series_Category> seriesMap = chart.getSeriesMap(); Map<String, Series_Category> seriesMap = chart.getSeriesMap();
......
...@@ -85,11 +85,11 @@ public class PlotContent_Category_Line_Area_Scatter<ST extends Styler, S extends ...@@ -85,11 +85,11 @@ public class PlotContent_Category_Line_Area_Scatter<ST extends Styler, S extends
// g.setClip(bounds.createIntersection(g.getClipBounds())); // g.setClip(bounds.createIntersection(g.getClipBounds()));
// X-Axis // X-Axis
double xTickSpace = stylerCategory.getAxisTickSpacePercentage() * bounds.getWidth(); double xTickSpace = stylerCategory.getPlotContentSize() * bounds.getWidth();
double xLeftMargin = Utils.getTickStartOffset((int) bounds.getWidth(), xTickSpace); double xLeftMargin = Utils.getTickStartOffset((int) bounds.getWidth(), xTickSpace);
// Y-Axis // Y-Axis
double yTickSpace = stylerCategory.getAxisTickSpacePercentage() * bounds.getHeight(); double yTickSpace = stylerCategory.getPlotContentSize() * bounds.getHeight();
double yTopMargin = Utils.getTickStartOffset((int) bounds.getHeight(), yTickSpace); double yTopMargin = Utils.getTickStartOffset((int) bounds.getHeight(), yTickSpace);
double xMin = chart.getAxisPair().getXAxis().getMin(); double xMin = chart.getAxisPair().getXAxis().getMin();
......
...@@ -75,7 +75,7 @@ public class PlotContent_Pie<ST extends Styler, S extends Series> extends PlotCo ...@@ -75,7 +75,7 @@ public class PlotContent_Pie<ST extends Styler, S extends Series> extends PlotCo
g.setClip(bounds.createIntersection(rectangle)); g.setClip(bounds.createIntersection(rectangle));
// pie bounds // pie bounds
double pieFillPercentage = stylerPie.getPieSize(); double pieFillPercentage = stylerPie.getPlotContentSize();
// if (stylerPie.isCircular()) { // if (stylerPie.isCircular()) {
// //
......
...@@ -82,11 +82,11 @@ public class PlotContent_XY<ST extends Styler_AxesChart, S extends Series> exten ...@@ -82,11 +82,11 @@ public class PlotContent_XY<ST extends Styler_AxesChart, S extends Series> exten
// g.setClip(bounds.createIntersection(g.getClipBounds())); // g.setClip(bounds.createIntersection(g.getClipBounds()));
// X-Axis // X-Axis
double xTickSpace = stylerXY.getAxisTickSpacePercentage() * bounds.getWidth(); double xTickSpace = stylerXY.getPlotContentSize() * bounds.getWidth();
double xLeftMargin = Utils.getTickStartOffset((int) bounds.getWidth(), xTickSpace); double xLeftMargin = Utils.getTickStartOffset((int) bounds.getWidth(), xTickSpace);
// Y-Axis // Y-Axis
double yTickSpace = stylerXY.getAxisTickSpacePercentage() * bounds.getHeight(); double yTickSpace = stylerXY.getPlotContentSize() * bounds.getHeight();
double yTopMargin = Utils.getTickStartOffset((int) bounds.getHeight(), yTickSpace); double yTopMargin = Utils.getTickStartOffset((int) bounds.getHeight(), yTickSpace);
double xMin = chart.getXAxis().getMin(); double xMin = chart.getXAxis().getMin();
......
...@@ -49,7 +49,7 @@ public class Plot_AxesChart<ST extends Styler, S extends Series> extends Plot_ { ...@@ -49,7 +49,7 @@ public class Plot_AxesChart<ST extends Styler, S extends Series> extends Plot_ {
// calculate bounds // calculate bounds
double xOffset = chart.getYAxis().getBounds().getX() + chart.getYAxis().getBounds().getWidth() double xOffset = chart.getYAxis().getBounds().getX() + chart.getYAxis().getBounds().getWidth()
+ (stylerAxesChart.isYAxisTicksVisible() ? stylerAxesChart.getPlotPadding() : 0); + (stylerAxesChart.isYAxisTicksVisible() ? stylerAxesChart.getPlotMargin() : 0);
double yOffset = chart.getYAxis().getBounds().getY(); double yOffset = chart.getYAxis().getBounds().getY();
double width = chart.getXAxis().getBounds().getWidth(); double width = chart.getXAxis().getBounds().getWidth();
......
...@@ -91,6 +91,7 @@ public abstract class Styler { ...@@ -91,6 +91,7 @@ public abstract class Styler {
private Color plotBackgroundColor; private Color plotBackgroundColor;
private Color plotBorderColor; private Color plotBorderColor;
private boolean isPlotBorderVisible; private boolean isPlotBorderVisible;
private double plotContentSize = .92;
protected void setAllStyles() { protected void setAllStyles() {
...@@ -123,6 +124,7 @@ public abstract class Styler { ...@@ -123,6 +124,7 @@ public abstract class Styler {
plotBackgroundColor = theme.getPlotBackgroundColor(); plotBackgroundColor = theme.getPlotBackgroundColor();
plotBorderColor = theme.getPlotBorderColor(); plotBorderColor = theme.getPlotBorderColor();
isPlotBorderVisible = theme.isPlotBorderVisible(); isPlotBorderVisible = theme.isPlotBorderVisible();
plotContentSize = theme.getPlotContentSize();
} }
// Chart Style /////////////////////////////// // Chart Style ///////////////////////////////
...@@ -453,4 +455,23 @@ public abstract class Styler { ...@@ -453,4 +455,23 @@ public abstract class Styler {
return isPlotBorderVisible; return isPlotBorderVisible;
} }
public double getPlotContentSize() {
return plotContentSize;
}
/**
* Sets the content size of the plot inside the plot area of the chart. To fill the area 100%, use a value of 1.0.
*
* @param plotContentSize - Valid range is between 0 and 1.
*/
public void setPlotContentSize(double plotContentSize) {
if (plotContentSize < 0 || plotContentSize > 1) {
throw new IllegalArgumentException("Plot content size must be tween 0 and 1!!!");
}
this.plotContentSize = plotContentSize;
}
} }
...@@ -41,7 +41,7 @@ public abstract class Styler_AxesChart extends Styler { ...@@ -41,7 +41,7 @@ public abstract class Styler_AxesChart extends Styler {
private Color axisTickLabelsColor; private Color axisTickLabelsColor;
private boolean isAxisTicksLineVisible; private boolean isAxisTicksLineVisible;
private boolean isAxisTicksMarksVisible; private boolean isAxisTicksMarksVisible;
private int plotPadding; private int plotMargin;
private int axisTitlePadding; private int axisTitlePadding;
private int xAxisTickMarkSpacingHint; private int xAxisTickMarkSpacingHint;
private int yAxisTickMarkSpacingHint; private int yAxisTickMarkSpacingHint;
...@@ -51,7 +51,6 @@ public abstract class Styler_AxesChart extends Styler { ...@@ -51,7 +51,6 @@ public abstract class Styler_AxesChart extends Styler {
private Double xAxisMax; private Double xAxisMax;
private Double yAxisMin; private Double yAxisMin;
private Double yAxisMax; private Double yAxisMax;
private double axisTickSpacePercentage;
private TextAlignment xAxisLabelAlignment = TextAlignment.Centre; private TextAlignment xAxisLabelAlignment = TextAlignment.Centre;
private TextAlignment yAxisLabelAlignment = TextAlignment.Left; private TextAlignment yAxisLabelAlignment = TextAlignment.Left;
private int xAxisLabelRotation = 0; private int xAxisLabelRotation = 0;
...@@ -102,7 +101,7 @@ public abstract class Styler_AxesChart extends Styler { ...@@ -102,7 +101,7 @@ public abstract class Styler_AxesChart extends Styler {
axisTickLabelsColor = theme.getAxisTickLabelsColor(); axisTickLabelsColor = theme.getAxisTickLabelsColor();
isAxisTicksLineVisible = theme.isAxisTicksLineVisible(); isAxisTicksLineVisible = theme.isAxisTicksLineVisible();
isAxisTicksMarksVisible = theme.isAxisTicksMarksVisible(); isAxisTicksMarksVisible = theme.isAxisTicksMarksVisible();
plotPadding = theme.getPlotPadding(); plotMargin = theme.getPlotMargin();
axisTitlePadding = theme.getAxisTitlePadding(); axisTitlePadding = theme.getAxisTitlePadding();
xAxisTickMarkSpacingHint = theme.getXAxisTickMarkSpacingHint(); xAxisTickMarkSpacingHint = theme.getXAxisTickMarkSpacingHint();
yAxisTickMarkSpacingHint = theme.getYAxisTickMarkSpacingHint(); yAxisTickMarkSpacingHint = theme.getYAxisTickMarkSpacingHint();
...@@ -112,7 +111,6 @@ public abstract class Styler_AxesChart extends Styler { ...@@ -112,7 +111,6 @@ public abstract class Styler_AxesChart extends Styler {
xAxisMax = null; xAxisMax = null;
yAxisMin = null; yAxisMin = null;
yAxisMax = null; yAxisMax = null;
axisTickSpacePercentage = .92;
// Chart Plot Area /////////////////////////////// // Chart Plot Area ///////////////////////////////
isPlotGridVerticalLinesVisible = theme.isPlotGridVerticalLinesVisible(); isPlotGridVerticalLinesVisible = theme.isPlotGridVerticalLinesVisible();
...@@ -284,7 +282,6 @@ public abstract class Styler_AxesChart extends Styler { ...@@ -284,7 +282,6 @@ public abstract class Styler_AxesChart extends Styler {
* *
* @param axisTickPadding * @param axisTickPadding
*/ */
public void setAxisTickPadding(int axisTickPadding) { public void setAxisTickPadding(int axisTickPadding) {
this.axisTickPadding = axisTickPadding; this.axisTickPadding = axisTickPadding;
...@@ -376,19 +373,19 @@ public abstract class Styler_AxesChart extends Styler { ...@@ -376,19 +373,19 @@ public abstract class Styler_AxesChart extends Styler {
} }
/** /**
* sets the padding between the tick marks and the plot area * sets the margin around the plot area
* *
* @param plotPadding * @param plotMargin
*/ */
public void setPlotPadding(int plotPadding) { public void setPlotMargin(int plotMargin) {
this.plotPadding = plotPadding; this.plotMargin = plotMargin;
} }
public int getPlotPadding() { public int getPlotMargin() {
return plotPadding; return plotMargin;
} }
/** /**
...@@ -511,16 +508,6 @@ public abstract class Styler_AxesChart extends Styler { ...@@ -511,16 +508,6 @@ public abstract class Styler_AxesChart extends Styler {
return yAxisMax; return yAxisMax;
} }
public void setAxisTickSpacePercentage(double axisTickSpacePercentage) {
this.axisTickSpacePercentage = axisTickSpacePercentage;
}
public double getAxisTickSpacePercentage() {
return axisTickSpacePercentage;
}
public TextAlignment getXAxisLabelAlignment() { public TextAlignment getXAxisLabelAlignment() {
return xAxisLabelAlignment; return xAxisLabelAlignment;
......
...@@ -99,8 +99,6 @@ public interface Theme_ extends SeriesMarkers, SeriesLines, SeriesColors { ...@@ -99,8 +99,6 @@ public interface Theme_ extends SeriesMarkers, SeriesLines, SeriesColors {
public int getAxisTitlePadding(); public int getAxisTitlePadding();
public int getPlotPadding();
public int getXAxisTickMarkSpacingHint(); public int getXAxisTickMarkSpacingHint();
public int getYAxisTickMarkSpacingHint(); public int getYAxisTickMarkSpacingHint();
...@@ -125,6 +123,10 @@ public interface Theme_ extends SeriesMarkers, SeriesLines, SeriesColors { ...@@ -125,6 +123,10 @@ public interface Theme_ extends SeriesMarkers, SeriesLines, SeriesColors {
public boolean isPlotTicksMarksVisible(); public boolean isPlotTicksMarksVisible();
public double getPlotContentSize();
public int getPlotMargin();
// Bar Charts /////////////////////////////// // Bar Charts ///////////////////////////////
public double getBarWidthPercentage(); public double getBarWidthPercentage();
...@@ -135,8 +137,6 @@ public interface Theme_ extends SeriesMarkers, SeriesLines, SeriesColors { ...@@ -135,8 +137,6 @@ public interface Theme_ extends SeriesMarkers, SeriesLines, SeriesColors {
// Pie Charts /////////////////////////////// // Pie Charts ///////////////////////////////
public double getPieSize();
public boolean isCircular(); public boolean isCircular();
public double getStartAngleInDegrees(); public double getStartAngleInDegrees();
......
...@@ -205,21 +205,21 @@ public class Theme_GGPlot2 implements Theme_ { ...@@ -205,21 +205,21 @@ public class Theme_GGPlot2 implements Theme_ {
} }
@Override @Override
public boolean isAxisTicksLineVisible() { public int getPlotMargin() {
return false; return 0;
} }
@Override @Override
public boolean isAxisTicksMarksVisible() { public boolean isAxisTicksLineVisible() {
return true; return false;
} }
@Override @Override
public int getPlotPadding() { public boolean isAxisTicksMarksVisible() {
return 0; return true;
} }
@Override @Override
...@@ -315,6 +315,12 @@ public class Theme_GGPlot2 implements Theme_ { ...@@ -315,6 +315,12 @@ public class Theme_GGPlot2 implements Theme_ {
return new BasicStroke(1.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 10.0f, new float[] { 3.0f, 0.0f }, 0.0f); return new BasicStroke(1.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 10.0f, new float[] { 3.0f, 0.0f }, 0.0f);
} }
@Override
public double getPlotContentSize() {
return .92;
}
// Bar Charts /////////////////////////////// // Bar Charts ///////////////////////////////
@Override @Override
...@@ -337,12 +343,6 @@ public class Theme_GGPlot2 implements Theme_ { ...@@ -337,12 +343,6 @@ public class Theme_GGPlot2 implements Theme_ {
// Pie Charts /////////////////////////////// // Pie Charts ///////////////////////////////
@Override
public double getPieSize() {
return .90;
}
@Override @Override
public boolean isCircular() { public boolean isCircular() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment