diff --git a/nbproject/project.properties b/nbproject/project.properties index 106576b..310d550 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,4 +1,4 @@ -#Sat, 20 Jan 2018 00:00:54 +0100 +#Sat, 20 Jan 2018 21:21:05 +0100 annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processors.list= diff --git a/src/chart/painter/YLegendPainter.java b/src/chart/painter/YLegendPainter.java index 76672c7..c02a820 100644 --- a/src/chart/painter/YLegendPainter.java +++ b/src/chart/painter/YLegendPainter.java @@ -26,6 +26,7 @@ package chart.painter; import chart.Chart; +import java.awt.Color; import sesim.ChartDef; import sesim.ChartPanel; import java.awt.Dimension; @@ -69,40 +70,41 @@ public class YLegendPainter extends OHLCChartPainter { float stepsize = (y_max - y_min) / steps; // round stepsize to power of 10 - float stepsize10 = (float)Math.pow(10,Math.ceil(Math.log10(stepsize))); - + float stepsize10 = (float) Math.pow(10, Math.ceil(Math.log10(stepsize))); + // build inverse of stepsize float stepsize10i = 1 / stepsize10; // calculate the first y value - float firstyv = (float)Math.ceil(y_min * stepsize10i) / stepsize10i; - + float firstyv = (float) Math.ceil(y_min * stepsize10i) / stepsize10i; + float y1 = getY(minmax.getMin(false)); - float y2 = getY(minmax.getMax(false)); - + float y2 = getY(minmax.getMax(false)); + int c_font_height = g.getFontMetrics().getHeight(); - - for (float yv=firstyv; yv