From f337d87798a755e87afbc7fa713af8a4cbaf35cc Mon Sep 17 00:00:00 2001 From: yu_xh <940151214@qq.com> Date: Thu, 16 Sep 2021 10:33:36 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9Y=E8=BD=B4=E7=AC=AC?= =?UTF-8?q?=E4=BA=8C=E5=88=BB=E5=BA=A6=E6=96=87=E6=A1=88=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=202.=E4=BF=AE=E6=94=B9XY=E8=BD=B4=E6=96=87?= =?UTF-8?q?=E5=AD=97=E8=BF=87=E5=AE=BD=E6=97=B6=E9=81=AE=E6=8C=A1=E5=88=BB?= =?UTF-8?q?=E5=BA=A6=E7=BA=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/config.json | 3 +-- entry/src/main/resources/base/element/string.json | 4 ++++ graphveiw/build.gradle | 6 ------ graphveiw/src/main/java/com/jjoe64/graphveiw/GraphView.java | 4 ++-- .../main/java/com/jjoe64/graphveiw/GridLabelRenderer.java | 5 +++-- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/entry/src/main/config.json b/entry/src/main/config.json index 60398fc..31c0dad 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -44,11 +44,10 @@ } ], "orientation": "unspecified", - "formEnabled": false, "name": "com.jjoe64.graphview_os.MainAbility", "icon": "$media:icon", "description": "$string:mainability_description", - "label": "GraphView_OS", + "label": "$string:app_lable", "type": "page", "launchType": "standard" } diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index e397e6a..f21d348 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -15,6 +15,10 @@ { "name": "is_cancel", "value": "取消" + }, + { + "name": "app_lable", + "value": "GraphView_OS" } ] } \ No newline at end of file diff --git a/graphveiw/build.gradle b/graphveiw/build.gradle index 2641989..115ec9d 100644 --- a/graphveiw/build.gradle +++ b/graphveiw/build.gradle @@ -1,10 +1,4 @@ apply plugin: 'com.huawei.ohos.library' -//apply from: '../upload.gradle' -//rootProject.ext { -// DEFAULT_GROUP_ID='io.openharmony.tpc.thirdlib' // 固定的groupId,不需要改动 -// DEFAULT_ARTIFACT_ID='graphView-library' // 项目ID,填写上传到maven仓库项目名称,如果是多个library,可根据实际情况使用项目名加library名来区分 -// DEFAULT_VERSION='1.0.1' // 版本号,发布版本时修改 -//} ohos { compileSdkVersion 5 defaultConfig { diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/GraphView.java b/graphveiw/src/main/java/com/jjoe64/graphveiw/GraphView.java index 4e7adf8..8a47c4e 100644 --- a/graphveiw/src/main/java/com/jjoe64/graphveiw/GraphView.java +++ b/graphveiw/src/main/java/com/jjoe64/graphveiw/GraphView.java @@ -404,7 +404,7 @@ public class GraphView extends Component implements Component.DrawTask, Componen */ public int getGraphContentLeft() { int border = getGridLabelRenderer().getStyles().padding; - return border + getGridLabelRenderer().getLabelVerticalWidth() + getGridLabelRenderer().getVerticalAxisTitleWidth(); + return border + getGridLabelRenderer().getLabelVerticalWidth() + getGridLabelRenderer().getVerticalAxisTitleWidth()+20; } /** @@ -443,7 +443,7 @@ public class GraphView extends Component implements Component.DrawTask, Componen graphwidth -= getGridLabelRenderer().getLabelVerticalSecondScaleWidth(); graphwidth -= mSecondScale.getVerticalAxisTitleTextSize(); } - return graphwidth; + return graphwidth-40; } /** diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/GridLabelRenderer.java b/graphveiw/src/main/java/com/jjoe64/graphveiw/GridLabelRenderer.java index 0e34055..0cb49ed 100644 --- a/graphveiw/src/main/java/com/jjoe64/graphveiw/GridLabelRenderer.java +++ b/graphveiw/src/main/java/com/jjoe64/graphveiw/GridLabelRenderer.java @@ -1284,7 +1284,7 @@ public class GridLabelRenderer { canvas.drawText(mPaintLabel, lines[li], x - labelWidthAdj, y); canvas.restore(); } else { - canvas.drawText(mPaintLabel, lines[li], x, y); + canvas.drawText(mPaintLabel, lines[li], x-5, y); } } } @@ -1306,7 +1306,8 @@ public class GridLabelRenderer { // draw only the vertical labels on the right float startLeft = mGraphView.getGraphContentLeft() + mGraphView.getGraphContentWidth(); // mPaintLabel.setColor(new Color(getVerticalLabelsSecondScaleColor())); - mPaintLabel.setColor(new Color(Color.getIntColor("#FFFF00"))); + //Y轴第二刻度文案颜色 + mPaintLabel.setColor(new Color(Color.getIntColor("#000000"))); mPaintLabel.setTextAlign(getVerticalLabelsSecondScaleAlign()); for (Map.Entry e : mStepsVerticalSecondScale.entrySet()) { float posY = mGraphView.getGraphContentTop() + mGraphView.getGraphContentHeight() - e.getKey(); -- Gitee