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
No related tags found
No related merge requests found
......@@ -65,7 +65,7 @@ public class ScatterChart02 implements ExampleChart {
chart.getStyleManager().setXAxisLogarithmic(true);
// Customize Chart
chart.getStyleManager().setLegendPosition(LegendPosition.InsideNW);
chart.getStyleManager().setLegendPosition(LegendPosition.InsideN);
// Series
chart.addSeries("logarithmic data", xData, yData);
......
......@@ -41,7 +41,7 @@ public class StyleManager {
public enum LegendPosition {
OutsideE, InsideNW, InsideNE, InsideSE, InsideSW
OutsideE, InsideNW, InsideNE, InsideSE, InsideSW, InsideN
}
public enum ChartTheme {
......
......@@ -146,6 +146,10 @@ public class Legend implements ChartPart {
xOffset = chartPainter.getPlot().getBounds().getX() + LEGEND_MARGIN;
yOffset = chartPainter.getPlot().getBounds().getY() + chartPainter.getPlot().getBounds().getHeight() - legendBoxHeight - LEGEND_MARGIN;
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:
break;
......
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