diff --git a/entry/src/main/config.json b/entry/src/main/config.json index 60398fc6846299c9c76c3edf6084811a1581a26a..31c0dad322c0b408f1f40d9d3672c3a459d70516 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 e397e6acd3fcec3cc391170de8a29ec9ae54427f..f21d348bc0e270d78b6bea110c47ea82d3c986f0 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 2641989063507fd88439b5d0de3653262cea6f03..115ec9dab4917734bb2e858c3797e205259e0bf5 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 4e7adf8acef4add0d0a8f06ded89e2908acfedde..8a47c4e60ed7710e71c7471fe1b7370433a3dac3 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 0e34055fa28448d8853d313667bb3edbbac06a3d..0cb49ed79d455d52bb4006b5a97ee533d1211e6c 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();