From 7a390c49cca0e99d28270a1bff7bc5f11d6bc88b Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Wed, 10 Jan 2018 10:56:55 +0100 Subject: [PATCH] Work on y legend detail --- nbproject/project.properties | 2 +- src/chart/painter/ChartPainter.java | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nbproject/project.properties b/nbproject/project.properties index d2087c7..8357980 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -1,4 +1,4 @@ -#Sun, 07 Jan 2018 23:34:07 +0100 +#Wed, 10 Jan 2018 10:18:15 +0100 annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processors.list= diff --git a/src/chart/painter/ChartPainter.java b/src/chart/painter/ChartPainter.java index 87aeec4..eea00c8 100644 --- a/src/chart/painter/ChartPainter.java +++ b/src/chart/painter/ChartPainter.java @@ -70,6 +70,7 @@ abstract public class ChartPainter implements ChartPainterInterface{ protected float y_scaling; protected int y_height; protected float y_min; + protected float y_max; float getY(float y) { //c_yscaling = ctx.rect.height / c_mm.getDiff(); @@ -99,7 +100,15 @@ abstract public class ChartPainter implements ChartPainterInterface{ protected float getRoundNumber(float n){ - System.out.printf("Rounded number", 0); + + + int ldist = this.em_size*2; + int steps = y_height/ldist; + + System.out.printf("Steps = %d, h: %d\n", steps, y_height); + + + return (float)0.0; } @@ -108,6 +117,7 @@ abstract public class ChartPainter implements ChartPainterInterface{ y_height = dim.height; y_scaling = dim.height / minmax.getDiff(); y_min = minmax.getMin(); + y_max = minmax.getMax(); } @Override