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

added north inside position for legend

parent e42bd6c3
No related branches found
Tags
No related merge requests found
...@@ -65,7 +65,7 @@ public class ScatterChart02 implements ExampleChart { ...@@ -65,7 +65,7 @@ public class ScatterChart02 implements ExampleChart {
chart.getStyleManager().setXAxisLogarithmic(true); chart.getStyleManager().setXAxisLogarithmic(true);
// Customize Chart // Customize Chart
chart.getStyleManager().setLegendPosition(LegendPosition.InsideNW); chart.getStyleManager().setLegendPosition(LegendPosition.InsideN);
// Series // Series
chart.addSeries("logarithmic data", xData, yData); chart.addSeries("logarithmic data", xData, yData);
......
...@@ -41,7 +41,7 @@ public class StyleManager { ...@@ -41,7 +41,7 @@ public class StyleManager {
public enum LegendPosition { public enum LegendPosition {
OutsideE, InsideNW, InsideNE, InsideSE, InsideSW OutsideE, InsideNW, InsideNE, InsideSE, InsideSW, InsideN
} }
public enum ChartTheme { public enum ChartTheme {
......
...@@ -146,6 +146,10 @@ public class Legend implements ChartPart { ...@@ -146,6 +146,10 @@ public class Legend implements ChartPart {
xOffset = chartPainter.getPlot().getBounds().getX() + LEGEND_MARGIN; xOffset = chartPainter.getPlot().getBounds().getX() + LEGEND_MARGIN;
yOffset = chartPainter.getPlot().getBounds().getY() + chartPainter.getPlot().getBounds().getHeight() - legendBoxHeight - LEGEND_MARGIN; yOffset = chartPainter.getPlot().getBounds().getY() + chartPainter.getPlot().getBounds().getHeight() - legendBoxHeight - LEGEND_MARGIN;
break; break;
case InsideN:
xOffset = chartPainter.getPlot().getBounds().getX() + (chartPainter.getPlot().getBounds().getWidth() - legendBoxWidth) / 2 + LEGEND_MARGIN;
yOffset = chartPainter.getPlot().getBounds().getY() + LEGEND_MARGIN;
break;
default: default:
break; break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment