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

misc. cleanup

parent 827e574f
No related branches found
No related tags found
No related merge requests found
...@@ -57,18 +57,18 @@ public class AxisTick implements ChartPart { ...@@ -57,18 +57,18 @@ public class AxisTick implements ChartPart {
@Override @Override
public void paint(Graphics2D g) { public void paint(Graphics2D g) {
double workingSpace = 0.0; // double workingSpace = 0.0;
// Y-Axis // // Y-Axis
if (axis.getDirection() == Axis.Direction.Y) { // if (axis.getDirection() == Axis.Direction.Y) {
workingSpace = axis.getPaintZone().getHeight(); // number of pixels the axis has to work with for drawing AxisTicks // workingSpace = axis.getPaintZone().getHeight(); // number of pixels the axis has to work with for drawing AxisTicks
// System.out.println("workingspace= " + workingSpace); // // System.out.println("workingspace= " + workingSpace);
} // }
// X-Axis // // X-Axis
else if (axis.getDirection() == Axis.Direction.X) { // else if (axis.getDirection() == Axis.Direction.X) {
workingSpace = axis.getPaintZone().getWidth(); // number of pixels the axis has to work with for drawing AxisTicks // workingSpace = axis.getPaintZone().getWidth(); // number of pixels the axis has to work with for drawing AxisTicks
// System.out.println("workingspace= " + workingSpace); // // System.out.println("workingspace= " + workingSpace);
} // }
//
// System.out.println("AxisTick: " + axis.getDirection()); // System.out.println("AxisTick: " + axis.getDirection());
// System.out.println("workingSpace: " + workingSpace); // System.out.println("workingSpace: " + workingSpace);
...@@ -98,8 +98,17 @@ public class AxisTick implements ChartPart { ...@@ -98,8 +98,17 @@ public class AxisTick implements ChartPart {
axisTickLabels.paint(g); axisTickLabels.paint(g);
axisTickMarks.paint(g); axisTickMarks.paint(g);
bounds = new Rectangle2D.Double(axisTickMarks.getBounds().getX(), axisTickMarks.getBounds().getY(), axisTickLabels.getBounds().getWidth(), axisTickMarks.getBounds().getHeight() bounds = new Rectangle2D.Double(
+ getChartInternal().getStyleManager().getAxisTickPadding() + axisTickLabels.getBounds().getHeight());
axisTickMarks.getBounds().getX(),
axisTickMarks.getBounds().getY(),
axisTickLabels.getBounds().getWidth(),
axisTickMarks.getBounds().getHeight() + getChartInternal().getStyleManager().getAxisTickPadding() + axisTickLabels.getBounds().getHeight()
);
// g.setColor(Color.red); // g.setColor(Color.red);
// g.draw(bounds); // g.draw(bounds);
......
...@@ -53,7 +53,7 @@ public class PlotContentCategoricalChart extends PlotContent { ...@@ -53,7 +53,7 @@ public class PlotContentCategoricalChart extends PlotContent {
// g.setColor(Color.red); // g.setColor(Color.red);
// g.draw(bounds); // g.draw(bounds);
StyleManager styleManager = plot.getChartInternal().getStyleManager(); StyleManager styleManager = getChartInternal().getStyleManager();
// this is for preventing the series to be drawn outside the plot area if min and max is overridden to fall inside the data range // this is for preventing the series to be drawn outside the plot area if min and max is overridden to fall inside the data range
Rectangle rectangle = new Rectangle(0, 0, getChartInternal().getWidth(), getChartInternal().getHeight()); Rectangle rectangle = new Rectangle(0, 0, getChartInternal().getWidth(), getChartInternal().getHeight());
...@@ -70,8 +70,8 @@ public class PlotContentCategoricalChart extends PlotContent { ...@@ -70,8 +70,8 @@ public class PlotContentCategoricalChart extends PlotContent {
double yTickSpace = styleManager.getAxisTickSpacePercentage() * bounds.getHeight(); double yTickSpace = styleManager.getAxisTickSpacePercentage() * bounds.getHeight();
double yTopMargin = Utils.getTickStartOffset(bounds.getHeight(), yTickSpace); double yTopMargin = Utils.getTickStartOffset(bounds.getHeight(), yTickSpace);
int numBars = getChartInternal().getSeriesMap().values().iterator().next().getXData().size(); int numCategories = getChartInternal().getSeriesMap().values().iterator().next().getXData().size();
double gridStep = xTickSpace / numBars; double gridStep = xTickSpace / numCategories;
// plot series // plot series
int seriesCounter = 0; int seriesCounter = 0;
......
...@@ -59,7 +59,7 @@ public class PlotContentNumericalChart extends PlotContent { ...@@ -59,7 +59,7 @@ public class PlotContentNumericalChart extends PlotContent {
return; return;
} }
StyleManager styleManager = plot.getChartInternal().getStyleManager(); StyleManager styleManager = getChartInternal().getStyleManager();
// this is for preventing the series to be drawn outside the plot area if min and max is overridden to fall inside the data range // this is for preventing the series to be drawn outside the plot area if min and max is overridden to fall inside the data range
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment