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 {
@Override
public void paint(Graphics2D g) {
double workingSpace = 0.0;
// Y-Axis
if (axis.getDirection() == Axis.Direction.Y) {
workingSpace = axis.getPaintZone().getHeight(); // number of pixels the axis has to work with for drawing AxisTicks
// System.out.println("workingspace= " + workingSpace);
}
// X-Axis
else if (axis.getDirection() == Axis.Direction.X) {
workingSpace = axis.getPaintZone().getWidth(); // number of pixels the axis has to work with for drawing AxisTicks
// System.out.println("workingspace= " + workingSpace);
}
// double workingSpace = 0.0;
// // Y-Axis
// if (axis.getDirection() == Axis.Direction.Y) {
// workingSpace = axis.getPaintZone().getHeight(); // number of pixels the axis has to work with for drawing AxisTicks
// // System.out.println("workingspace= " + workingSpace);
// }
// // X-Axis
// else if (axis.getDirection() == Axis.Direction.X) {
// workingSpace = axis.getPaintZone().getWidth(); // number of pixels the axis has to work with for drawing AxisTicks
// // System.out.println("workingspace= " + workingSpace);
// }
//
// System.out.println("AxisTick: " + axis.getDirection());
// System.out.println("workingSpace: " + workingSpace);
......@@ -98,8 +98,17 @@ public class AxisTick implements ChartPart {
axisTickLabels.paint(g);
axisTickMarks.paint(g);
bounds = new Rectangle2D.Double(axisTickMarks.getBounds().getX(), axisTickMarks.getBounds().getY(), axisTickLabels.getBounds().getWidth(), axisTickMarks.getBounds().getHeight()
+ getChartInternal().getStyleManager().getAxisTickPadding() + axisTickLabels.getBounds().getHeight());
bounds = new Rectangle2D.Double(
axisTickMarks.getBounds().getX(),
axisTickMarks.getBounds().getY(),
axisTickLabels.getBounds().getWidth(),
axisTickMarks.getBounds().getHeight() + getChartInternal().getStyleManager().getAxisTickPadding() + axisTickLabels.getBounds().getHeight()
);
// g.setColor(Color.red);
// g.draw(bounds);
......
......@@ -53,7 +53,7 @@ public class PlotContentCategoricalChart extends PlotContent {
// g.setColor(Color.red);
// 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
Rectangle rectangle = new Rectangle(0, 0, getChartInternal().getWidth(), getChartInternal().getHeight());
......@@ -70,8 +70,8 @@ public class PlotContentCategoricalChart extends PlotContent {
double yTickSpace = styleManager.getAxisTickSpacePercentage() * bounds.getHeight();
double yTopMargin = Utils.getTickStartOffset(bounds.getHeight(), yTickSpace);
int numBars = getChartInternal().getSeriesMap().values().iterator().next().getXData().size();
double gridStep = xTickSpace / numBars;
int numCategories = getChartInternal().getSeriesMap().values().iterator().next().getXData().size();
double gridStep = xTickSpace / numCategories;
// plot series
int seriesCounter = 0;
......
......@@ -59,7 +59,7 @@ public class PlotContentNumericalChart extends PlotContent {
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
......
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