From b57c250a18fad8a8f35e52f1316c5cb70b1bc3a4 Mon Sep 17 00:00:00 2001 From: yu_xh <940151214@qq.com> Date: Tue, 23 Nov 2021 10:50:59 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E8=A7=A3=E5=86=B3setLabelsSpace=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=BF=87=E5=A4=A7=E5=AF=BC=E8=87=B4=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=A2=AB=E8=A3=81=E5=89=AA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/jjoe64/graphview/GridLabelRenderer.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/graphveiw/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java b/graphveiw/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java index d361f5d..95b2650 100644 --- a/graphveiw/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java +++ b/graphveiw/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java @@ -34,6 +34,9 @@ import java.util.Map; */ public class GridLabelRenderer { + private int LABELS_SPACE_MAX = 23; + private int LABELS_SPACE_MIN = 1; + /** * Hoziontal label alignment */ @@ -1928,10 +1931,10 @@ public class GridLabelRenderer { * @param labelsSpace the space between the labels text and the graph content */ public void setLabelsSpace(int labelsSpace) { - if (labelsSpace > 23) { - mStyles.labelsSpace = 23; - } else if (labelsSpace <= 0) { - mStyles.labelsSpace = 1; + if (labelsSpace > LABELS_SPACE_MAX) { + mStyles.labelsSpace = LABELS_SPACE_MAX; + } else if (labelsSpace < LABELS_SPACE_MIN) { + mStyles.labelsSpace = LABELS_SPACE_MIN; } else { mStyles.labelsSpace = labelsSpace; } -- Gitee From b2054b9833f8e6ead513b866afd64c62934f417c Mon Sep 17 00:00:00 2001 From: yu_xh <940151214@qq.com> Date: Tue, 23 Nov 2021 14:52:41 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8C=89=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jjoe64/graphview/GraphView.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java b/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java index 45d8b1f..0041fe4 100644 --- a/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java +++ b/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java @@ -38,7 +38,10 @@ import java.util.List; public class GraphView extends Component implements Component.DrawTask, Component.TouchEventListener { public static String TAG = "GraphView : "; - + //表格起始X坐标适配 + private int adaptationStartPoint = 20; + //表格总宽度的适配 + private int adaptationWidth = 40; @Override public void onDraw(Component component, Canvas canvas) { @@ -405,7 +408,7 @@ public class GraphView extends Component implements Component.DrawTask, Componen */ public int getGraphContentLeft() { int border = getGridLabelRenderer().getStyles().padding; - return border + getGridLabelRenderer().getLabelVerticalWidth() + getGridLabelRenderer().getVerticalAxisTitleWidth() + 20; + return border + getGridLabelRenderer().getLabelVerticalWidth() + getGridLabelRenderer().getVerticalAxisTitleWidth() + adaptationStartPoint; } /** @@ -444,7 +447,7 @@ public class GraphView extends Component implements Component.DrawTask, Componen graphwidth -= getGridLabelRenderer().getLabelVerticalSecondScaleWidth(); graphwidth -= mSecondScale.getVerticalAxisTitleTextSize(); } - return graphwidth - 40; + return graphwidth - adaptationWidth; } /** -- Gitee From 7567adb322ce1f12f520beaaeef5a1198f30c906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E6=97=AD=E6=98=8A?= <940151214@qq.com> Date: Wed, 29 Dec 2021 06:57:30 +0000 Subject: [PATCH 3/9] =?UTF-8?q?update=20changelog.md.=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 0efa85b..6ee83de 100644 --- a/changelog.md +++ b/changelog.md @@ -34,4 +34,6 @@ v1.1.0 22. Viewport --> public class Viewport 内OverScroller / onScroll 23. LineGraphSeries --> public class LineGraphSeries 内 AccelerateInterpolator 24. 如果2个图形系列具有相同的系列标题,具有不同的系列颜色,则图例中仅显示第一个系列信息 -25. When Y axis labels are huge values or strings, some part of vertical label is crossing vertical axis \ No newline at end of file +25. When Y axis labels are huge values or strings, some part of vertical label is crossing vertical axis +26.When background color is set for graph using setBackgroundColor() method, little bit of color is crossing horizontal axis" +27.setBorderColor and setBorderPaint methods of viewport class are not supported \ No newline at end of file -- Gitee From 5c2e754d489287548ae596b0d1b4ef50903869bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E6=97=AD=E6=98=8A?= <940151214@qq.com> Date: Wed, 29 Dec 2021 06:57:54 +0000 Subject: [PATCH 4/9] update changelog.md. --- changelog.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 6ee83de..7247475 100644 --- a/changelog.md +++ b/changelog.md @@ -35,5 +35,6 @@ v1.1.0 23. LineGraphSeries --> public class LineGraphSeries 内 AccelerateInterpolator 24. 如果2个图形系列具有相同的系列标题,具有不同的系列颜色,则图例中仅显示第一个系列信息 25. When Y axis labels are huge values or strings, some part of vertical label is crossing vertical axis -26.When background color is set for graph using setBackgroundColor() method, little bit of color is crossing horizontal axis" +26.When background color is set for graph using setBackgroundColor() method, + little bit of color is crossing horizontal axis" 27.setBorderColor and setBorderPaint methods of viewport class are not supported \ No newline at end of file -- Gitee From 4ce74c7dd295e71b0c05824e0ed4e8cd77f4ce95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E6=97=AD=E6=98=8A?= <940151214@qq.com> Date: Wed, 29 Dec 2021 06:58:45 +0000 Subject: [PATCH 5/9] update changelog.md. --- changelog.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index 7247475..2546908 100644 --- a/changelog.md +++ b/changelog.md @@ -35,6 +35,7 @@ v1.1.0 23. LineGraphSeries --> public class LineGraphSeries 内 AccelerateInterpolator 24. 如果2个图形系列具有相同的系列标题,具有不同的系列颜色,则图例中仅显示第一个系列信息 25. When Y axis labels are huge values or strings, some part of vertical label is crossing vertical axis -26.When background color is set for graph using setBackgroundColor() method, - little bit of color is crossing horizontal axis" + +26. When background color is set for graph using setBackgroundColor() method, little bit of color is crossing horizontal axis" + 27.setBorderColor and setBorderPaint methods of viewport class are not supported \ No newline at end of file -- Gitee From 448adc8126568b8d681efc16e78573489537e771 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E6=97=AD=E6=98=8A?= <940151214@qq.com> Date: Wed, 29 Dec 2021 07:00:42 +0000 Subject: [PATCH 6/9] update changelog.md. --- changelog.md | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/changelog.md b/changelog.md index 2546908..d194c90 100644 --- a/changelog.md +++ b/changelog.md @@ -23,19 +23,17 @@ v1.1.0 14. Viewport --> public double getMaxYAxisSize(); 15. Viewport --> public double setMaxXAxisSize(double mMaxXAxisViewportSize); 16. Viewport --> public double setMaxYAxisSize(double mMaxYAxisViewportSize); -16. Viewport --> public double setMinimalViewport(double minX,double maxX,double minY,double maxY); -17. StaticLabelsFormatter -- >StaticLabelsFormatter staticLabelsFormatter = new StaticLabelsFormatter(graphView_01,new String[] {"old", "new"},new String[] {"high", "low"}); +17. Viewport --> public double setMinimalViewport(double minX,double maxX,double minY,double maxY); +18. StaticLabelsFormatter -- >StaticLabelsFormatter staticLabelsFormatter = new StaticLabelsFormatter(graphView_01,new String[] {"old", "new"},new String[] {"high", "low"}); (When the static label formatter passes 2 different vertical labels, it displays the first label twice instead of displaying the two collection labels。) -18. GraphView --> public class GraphView 内takeSnapshotAndShare() -19. LineGraphSeries--> public class LineGraphSeries 内 public void setDrawAsPath() -20. LineGraphSeries -->public class LineGraphSeries 内 public void setAnimated(boolean animated) -21. BarGraphSeries --> public class BarGraphSeries 内 public void setAnimated(boolean animated) -22. Viewport --> public class Viewport 内OverScroller / onScroll -23. LineGraphSeries --> public class LineGraphSeries 内 AccelerateInterpolator -24. 如果2个图形系列具有相同的系列标题,具有不同的系列颜色,则图例中仅显示第一个系列信息 -25. When Y axis labels are huge values or strings, some part of vertical label is crossing vertical axis - -26. When background color is set for graph using setBackgroundColor() method, little bit of color is crossing horizontal axis" - -27.setBorderColor and setBorderPaint methods of viewport class are not supported \ No newline at end of file +19. GraphView --> public class GraphView 内takeSnapshotAndShare() +20. LineGraphSeries--> public class LineGraphSeries 内 public void setDrawAsPath() +21. LineGraphSeries -->public class LineGraphSeries 内 public void setAnimated(boolean animated) +22. BarGraphSeries --> public class BarGraphSeries 内 public void setAnimated(boolean animated) +23. Viewport --> public class Viewport 内OverScroller / onScroll +24. LineGraphSeries --> public class LineGraphSeries 内 AccelerateInterpolator +25. 如果2个图形系列具有相同的系列标题,具有不同的系列颜色,则图例中仅显示第一个系列信息 +26. When Y axis labels are huge values or strings, some part of vertical label is crossing vertical axis +27. When background color is set for graph using setBackgroundColor() method, little bit of color is crossing horizontal axis" +28.setBorderColor and setBorderPaint methods of viewport class are not supported \ No newline at end of file -- Gitee From e48e82830319f55bd9c92cf508a2553cf4884c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E6=97=AD=E6=98=8A?= <940151214@qq.com> Date: Wed, 29 Dec 2021 07:01:29 +0000 Subject: [PATCH 7/9] update changelog.md. --- changelog.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index d194c90..88fdf99 100644 --- a/changelog.md +++ b/changelog.md @@ -24,9 +24,10 @@ v1.1.0 15. Viewport --> public double setMaxXAxisSize(double mMaxXAxisViewportSize); 16. Viewport --> public double setMaxYAxisSize(double mMaxYAxisViewportSize); 17. Viewport --> public double setMinimalViewport(double minX,double maxX,double minY,double maxY); -18. StaticLabelsFormatter -- >StaticLabelsFormatter staticLabelsFormatter = new StaticLabelsFormatter(graphView_01,new String[] {"old", "new"},new String[] {"high", "low"}); - (When the static label formatter passes 2 different vertical labels, it displays the first label twice instead of displaying the two collection labels。) - +18. StaticLabelsFormatter -- >StaticLabelsFormatter staticLabelsFormatter = new StaticLabelsFormatter(graphView_01,new String[] {"old", "new"},new + String[] {"high", "low"}); + (When the static label formatter passes 2 different vertical labels, it displays the first label twice instead of displaying the two collection + labels。) 19. GraphView --> public class GraphView 内takeSnapshotAndShare() 20. LineGraphSeries--> public class LineGraphSeries 内 public void setDrawAsPath() 21. LineGraphSeries -->public class LineGraphSeries 内 public void setAnimated(boolean animated) @@ -36,4 +37,4 @@ v1.1.0 25. 如果2个图形系列具有相同的系列标题,具有不同的系列颜色,则图例中仅显示第一个系列信息 26. When Y axis labels are huge values or strings, some part of vertical label is crossing vertical axis 27. When background color is set for graph using setBackgroundColor() method, little bit of color is crossing horizontal axis" -28.setBorderColor and setBorderPaint methods of viewport class are not supported \ No newline at end of file +28. setBorderColor and setBorderPaint methods of viewport class are not supported \ No newline at end of file -- Gitee From 90a5ddb5895a2aa48bf185871a5c30bdc799427e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E6=97=AD=E6=98=8A?= <940151214@qq.com> Date: Wed, 29 Dec 2021 07:11:10 +0000 Subject: [PATCH 8/9] update changelog.md. --- changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 88fdf99..5913137 100644 --- a/changelog.md +++ b/changelog.md @@ -36,5 +36,5 @@ v1.1.0 24. LineGraphSeries --> public class LineGraphSeries 内 AccelerateInterpolator 25. 如果2个图形系列具有相同的系列标题,具有不同的系列颜色,则图例中仅显示第一个系列信息 26. When Y axis labels are huge values or strings, some part of vertical label is crossing vertical axis -27. When background color is set for graph using setBackgroundColor() method, little bit of color is crossing horizontal axis" +27. When background color is set for graph using setBackgroundColor() method, little bit of color is crossing horizontal axis 28. setBorderColor and setBorderPaint methods of viewport class are not supported \ No newline at end of file -- Gitee From 399af377eb8eae3ac0605c7f93e605f891e626a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E5=85=88=E7=94=9F?= <3415239542@qq.com> Date: Wed, 29 Dec 2021 15:28:07 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E6=8C=89=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/jjoe64/graphview/GraphView.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java b/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java index 0041fe4..d28596c 100644 --- a/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java +++ b/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java @@ -38,10 +38,11 @@ import java.util.List; public class GraphView extends Component implements Component.DrawTask, Component.TouchEventListener { public static String TAG = "GraphView : "; - //表格起始X坐标适配 + // 表格起始X坐标适配 private int adaptationStartPoint = 20; - //表格总宽度的适配 + // 表格总宽度的适配 private int adaptationWidth = 40; + @Override public void onDraw(Component component, Canvas canvas) { @@ -408,7 +409,8 @@ public class GraphView extends Component implements Component.DrawTask, Componen */ public int getGraphContentLeft() { int border = getGridLabelRenderer().getStyles().padding; - return border + getGridLabelRenderer().getLabelVerticalWidth() + getGridLabelRenderer().getVerticalAxisTitleWidth() + adaptationStartPoint; + return border + getGridLabelRenderer().getLabelVerticalWidth() + + getGridLabelRenderer().getVerticalAxisTitleWidth() + adaptationStartPoint; } /** -- Gitee