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

Merge branch 'develop'

parents c8b70b29 f2eaf437
Branches
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ Add the XChart library as a dependency to your pom.xml file: ...@@ -63,7 +63,7 @@ Add the XChart library as a dependency to your pom.xml file:
<dependency> <dependency>
<groupId>com.xeiam.xchart</groupId> <groupId>com.xeiam.xchart</groupId>
<artifactId>xchart</artifactId> <artifactId>xchart</artifactId>
<version>2.4.1</version> <version>2.4.2</version>
</dependency> </dependency>
For snapshots, add the following to your pom.xml file: For snapshots, add the following to your pom.xml file:
...@@ -77,7 +77,7 @@ For snapshots, add the following to your pom.xml file: ...@@ -77,7 +77,7 @@ For snapshots, add the following to your pom.xml file:
<dependency> <dependency>
<groupId>com.xeiam</groupId> <groupId>com.xeiam</groupId>
<artifactId>xchart</artifactId> <artifactId>xchart</artifactId>
<version>2.4.2-SNAPSHOT</version> <version>2.4.3-SNAPSHOT</version>
</dependency> </dependency>
## Building ## Building
...@@ -95,7 +95,7 @@ For snapshots, add the following to your pom.xml file: ...@@ -95,7 +95,7 @@ For snapshots, add the following to your pom.xml file:
## Running Demo ## Running Demo
cd /path/to/xchart-demo/jar/ cd /path/to/xchart-demo/jar/
java -cp xchart-demo-2.4.1.jar:xchart-2.4.1.jar com.xeiam.xchart.demo.XChartDemo java -cp xchart-demo-2.4.2.jar:xchart-2.4.2.jar com.xeiam.xchart.demo.XChartDemo
## Bugs ## Bugs
Please report any bugs or submit feature requests to [XChart's Github issue tracker](https://github.com/timmolter/XChart/issues). Please report any bugs or submit feature requests to [XChart's Github issue tracker](https://github.com/timmolter/XChart/issues).
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<groupId>com.xeiam.xchart</groupId> <groupId>com.xeiam.xchart</groupId>
<artifactId>xchart-parent</artifactId> <artifactId>xchart-parent</artifactId>
<version>2.4.2-SNAPSHOT</version> <version>2.4.3-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>XChart Parent</name> <name>XChart Parent</name>
<description>Basic Charts for Java Applications</description> <description>Basic Charts for Java Applications</description>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.xeiam.xchart</groupId> <groupId>com.xeiam.xchart</groupId>
<artifactId>xchart-parent</artifactId> <artifactId>xchart-parent</artifactId>
<version>2.4.2-SNAPSHOT</version> <version>2.4.3-SNAPSHOT</version>
</parent> </parent>
<artifactId>xchart-demo</artifactId> <artifactId>xchart-demo</artifactId>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<dependency> <dependency>
<groupId>com.xeiam.xchart</groupId> <groupId>com.xeiam.xchart</groupId>
<artifactId>xchart</artifactId> <artifactId>xchart</artifactId>
<version>2.4.2-SNAPSHOT</version> <version>2.4.3-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.xeiam.xchart</groupId> <groupId>com.xeiam.xchart</groupId>
<artifactId>xchart-parent</artifactId> <artifactId>xchart-parent</artifactId>
<version>2.4.2-SNAPSHOT</version> <version>2.4.3-SNAPSHOT</version>
</parent> </parent>
<artifactId>xchart</artifactId> <artifactId>xchart</artifactId>
......
...@@ -94,8 +94,8 @@ public class ChartTitle implements ChartPart { ...@@ -94,8 +94,8 @@ public class ChartTitle implements ChartPart {
TextLayout textLayout = new TextLayout(text, chartPainter.getStyleManager().getChartTitleFont(), frc); TextLayout textLayout = new TextLayout(text, chartPainter.getStyleManager().getChartTitleFont(), frc);
Rectangle2D rectangle = textLayout.getBounds(); Rectangle2D rectangle = textLayout.getBounds();
int xOffset = (int) chartPainter.getPlot().getBounds().getX(); double xOffset = (int) chartPainter.getPlot().getBounds().getX();
int yOffset = chartPainter.getStyleManager().getChartPadding(); double yOffset = chartPainter.getStyleManager().getChartPadding();
if (chartPainter.getStyleManager().isChartTitleBoxVisible()) { if (chartPainter.getStyleManager().isChartTitleBoxVisible()) {
...@@ -109,12 +109,11 @@ public class ChartTitle implements ChartPart { ...@@ -109,12 +109,11 @@ public class ChartTitle implements ChartPart {
g.fill(rect); g.fill(rect);
g.setColor(chartPainter.getStyleManager().getChartTitleBoxBorderColor()); g.setColor(chartPainter.getStyleManager().getChartTitleBoxBorderColor());
g.draw(rect); g.draw(rect);
} }
// paint title // paint title
xOffset = (int) (chartPainter.getPlot().getBounds().getX() + (chartPainter.getPlot().getBounds().getWidth() - rectangle.getWidth()) / 2.0); xOffset = chartPainter.getPlot().getBounds().getX() + (chartPainter.getPlot().getBounds().getWidth() - rectangle.getWidth()) / 2.0;
yOffset = (int) (chartPainter.getStyleManager().getChartPadding() - rectangle.getY() + chartPainter.getStyleManager().getChartTitlePadding()); yOffset = chartPainter.getStyleManager().getChartPadding() - rectangle.getY() + chartPainter.getStyleManager().getChartTitlePadding();
bounds = new Rectangle2D.Double(xOffset, yOffset + rectangle.getY(), rectangle.getWidth(), rectangle.getHeight()); bounds = new Rectangle2D.Double(xOffset, yOffset + rectangle.getY(), rectangle.getWidth(), rectangle.getHeight());
// g.setColor(Color.green); // g.setColor(Color.green);
......
...@@ -44,7 +44,6 @@ public class Plot implements ChartPart { ...@@ -44,7 +44,6 @@ public class Plot implements ChartPart {
this.chartPainter = chartPainter; this.chartPainter = chartPainter;
this.plotSurface = new PlotSurface(this); this.plotSurface = new PlotSurface(this);
} }
@Override @Override
......
...@@ -45,10 +45,17 @@ public class PlotContentBarChart extends PlotContent { ...@@ -45,10 +45,17 @@ public class PlotContentBarChart extends PlotContent {
public void paint(Graphics2D g) { public void paint(Graphics2D g) {
Rectangle2D bounds = plot.getBounds(); Rectangle2D bounds = plot.getBounds();
// g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
// g.setColor(Color.red);
// g.draw(bounds);
StyleManager styleManager = plot.getChartPainter().getStyleManager(); StyleManager styleManager = plot.getChartPainter().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, getChartPainter().getWidth(), getChartPainter().getHeight()); Rectangle rectangle = new Rectangle(0, 0, getChartPainter().getWidth(), getChartPainter().getHeight());
// g.setStroke(new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
// g.setColor(Color.green);
// g.draw(rectangle);
g.setClip(bounds.createIntersection(rectangle)); g.setClip(bounds.createIntersection(rectangle));
// X-Axis // X-Axis
...@@ -206,7 +213,7 @@ public class PlotContentBarChart extends PlotContent { ...@@ -206,7 +213,7 @@ public class PlotContentBarChart extends PlotContent {
} }
seriesCounter++; seriesCounter++;
} }
g.setClip(null);
} }
@Override @Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment