Skip to content
Snippets Groups Projects
Commit 8dc0dfae authored by Tim Molter's avatar Tim Molter Committed by Niklas Polke
Browse files

misc cleanup

parent 28d125df
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,7 @@ public class LineChart04 implements ExampleChart {
series.setLineStyle(SeriesLineStyle.SOLID);
series.setMarker(SeriesMarker.CIRCLE);
series.setMarkerColor(SeriesColor.BLUE);
}
return chart;
......
......@@ -88,7 +88,9 @@ public class XChartPanel extends JPanel {
super.paintComponent(g);
chart.paint((Graphics2D) g, getWidth(), getHeight());
Graphics2D g2d = (Graphics2D) g.create();
chart.paint(g2d, getWidth(), getHeight());
g2d.dispose();
}
@Override
......
......@@ -122,7 +122,8 @@ public class AxisTickLabels implements ChartPart {
// g.draw(bounds);
}
else if (axisTick.getAxis().getDirection() == Axis.Direction.X && getChartPainter().getStyleManager().isXAxisTicksVisible()) { // X-Axis
// X-Axis
else if (axisTick.getAxis().getDirection() == Axis.Direction.X && getChartPainter().getStyleManager().isXAxisTicksVisible()) {
double xOffset = axisTick.getAxis().getPaintZone().getX();
double yOffset = axisTick.getAxis().getAxisTitle().getBounds().getY();
......
......@@ -89,7 +89,8 @@ public class AxisTickMarks implements ChartPart {
}
}
else if (axisTick.getAxis().getDirection() == Axis.Direction.X && getChartPainter().getStyleManager().isXAxisTicksVisible()) { // X-Axis
// X-Axis
else if (axisTick.getAxis().getDirection() == Axis.Direction.X && getChartPainter().getStyleManager().isXAxisTicksVisible()) {
double xOffset = axisTick.getAxis().getPaintZone().getX();
double yOffset = axisTick.getAxisTickLabels().getBounds().getY() - getChartPainter().getStyleManager().getAxisTickPadding();
......@@ -120,10 +121,9 @@ public class AxisTickMarks implements ChartPart {
// Line
if (getChartPainter().getStyleManager().isAxisTicksLineVisible()) {
Shape line =
new Line2D.Double(xOffset, yOffset - getChartPainter().getStyleManager().getAxisTickMarkLength(), xOffset + axisTick.getAxis().getPaintZone().getWidth(), yOffset
- getChartPainter().getStyleManager().getAxisTickMarkLength());
g.draw(line);
g.setStroke(getChartPainter().getStyleManager().getAxisTickMarksStroke());
g.drawLine((int) xOffset, (int) (yOffset - getChartPainter().getStyleManager().getAxisTickMarkLength()), (int) (xOffset + axisTick.getAxis().getPaintZone().getWidth()),
(int) (yOffset - getChartPainter().getStyleManager().getAxisTickMarkLength()));
}
}
......
......@@ -109,7 +109,7 @@ public class ChartPainter {
axisPair.paint(g);
plot.paint(g);
// TODO why not just paint them first and skip the size hinting?
// TODO why not just paint the title first and skip the size hinting?
chartTitle.paint(g);
chartLegend.paint(g);
......
......@@ -280,6 +280,7 @@ public class PlotContentLineChart extends PlotContent {
}
g.setClip(null);
}
/**
......
......@@ -62,6 +62,7 @@ public class PlotSurface implements ChartPart {
// paint plot border
if (getChartPainter().getStyleManager().isPlotBorderVisible()) {
g.setColor(getChartPainter().getStyleManager().getPlotBorderColor());
// g.setStroke(getChartPainter().getStyleManager().getAxisTickMarksStroke());
g.draw(rect);
}
......@@ -84,6 +85,7 @@ public class PlotSurface implements ChartPart {
Shape line = new Line2D.Double(bounds.getX(), yOffset, bounds.getX() + bounds.getWidth(), yOffset);
g.draw(line);
}
// tick marks
if (getChartPainter().getStyleManager().isPlotTicksMarksVisible()) {
......@@ -100,11 +102,11 @@ public class PlotSurface implements ChartPart {
// vertical
if (getChartPainter().getStyleManager().getChartType() != ChartType.Bar
&& (getChartPainter().getStyleManager().isPlotGridLinesVisible()
&& (getChartPainter().getStyleManager().isPlotGridLinesVisible()
|| getChartPainter().getStyleManager().isPlotTicksMarksVisible())
|| getChartPainter().getStyleManager().isPlotTicksMarksVisible())
) {
) {
List<Double> xAxisTickLocations = getChartPainter().getAxisPair().getXAxis().getAxisTick().getTickLocations();
for (int i = 0; i < xAxisTickLocations.size(); i++) {
......
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