diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..326e29c8beb0029d79107241af5cf192d0b2f735
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,68 @@
+Copyright 2016 Jonas Gehring
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/README.md b/README.md
index 02b74be59f0b9462a8b4e084fb38f1310d4de527..8c74b979119fff3b5b9c0f928debc48f96956232 100644
--- a/README.md
+++ b/README.md
@@ -1,20 +1,18 @@
# GraphView_openharmony
### 折线图/圆点图/柱状图
-
+
## 集成配置
-
```
方式一:
-通过library生成har包,添加har包到libs文件夹内
-在entry的gradle内添加如下代码
-implementation fileTree(dir: 'libs', include: ['*.jar', '*.har'])
+1.将graphView-library.har放到相应module的libs目录下
+2.如果已经有implementation fileTree(dir: 'libs', include: ['.jar']),则修改为implementation fileTree(dir: 'libs', include: ['.jar','.har'])
+ 如果没有,直接添加依赖 implementation fileTree(dir: 'libs', include: ['.jar','*.har']) 即可
```
-
```
方式二:
allprojects{
@@ -22,19 +20,17 @@ allprojects{
mavenCentral()
}
}
-implementation 'io.openharmony.tpc.thirdlib:graphView-library:1.0.1'
+implementation 'io.openharmony.tpc.thirdlib:graphView-library:1.0.2'
```
-2. Add view to layout:
+#### 一.GraphView介绍
-3. Add some data:
-
GraphView graph = (GraphView) findComponentById(ResourceTable.Id_graphView);
LineGraphSeries series = new LineGraphSeries(new DataPoint[] {
new DataPoint(0, 1),
@@ -45,4 +41,27 @@ implementation 'io.openharmony.tpc.thirdlib:graphView-library:1.0.1'
});
graph.addSeries(series);
-### End
\ No newline at end of file
+
+#### 二.GraphViewXML 自定义介绍
+```
+ ,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
import ohos.aafwk.ability.Ability;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.IntentParams;
import ohos.aafwk.content.Operation;
-
public abstract class BaseAbility extends Ability {
@Override
protected void onStart(Intent intent) {
diff --git a/entry/src/main/java/com/jjoe64/graphview_os/base/BaseAbilitySlice.java b/entry/src/main/java/com/jjoe64/graphview_os/base/BaseAbilitySlice.java
index e62df50eaa5e663e2efa6ea6d0c9362cce6a54aa..fbb8c3d8f4e61364c7c50cb854a1349c919eeca3 100644
--- a/entry/src/main/java/com/jjoe64/graphview_os/base/BaseAbilitySlice.java
+++ b/entry/src/main/java/com/jjoe64/graphview_os/base/BaseAbilitySlice.java
@@ -1,37 +1,5 @@
package com.jjoe64.graphview_os.base;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
+
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.aafwk.content.IntentParams;
diff --git a/entry/src/main/java/com/jjoe64/graphview_os/slice/MainAbilitySlice.java b/entry/src/main/java/com/jjoe64/graphview_os/slice/MainAbilitySlice.java
index 31437ca9514c6cf307bcfa1b200a3e679dfd0717..bdf9999e38cd0cb5ed63e0cfa85871ccb9ca414a 100644
--- a/entry/src/main/java/com/jjoe64/graphview_os/slice/MainAbilitySlice.java
+++ b/entry/src/main/java/com/jjoe64/graphview_os/slice/MainAbilitySlice.java
@@ -1,15 +1,15 @@
package com.jjoe64.graphview_os.slice;
-import com.jjoe64.graphveiw.GraphView;
-import com.jjoe64.graphveiw.helper.GraphViewXML;
-import com.jjoe64.graphveiw.series.BarGraphSeries;
-import com.jjoe64.graphveiw.series.DataPoint;
-import com.jjoe64.graphveiw.series.DataPointInterface;
-import com.jjoe64.graphveiw.series.LineGraphSeries;
-import com.jjoe64.graphveiw.series.OnDataPointTapListener;
-import com.jjoe64.graphveiw.series.PointsGraphSeries;
-import com.jjoe64.graphveiw.series.Series;
-import com.jjoe64.graphveiw.utils.LogUtil;
+import com.jjoe64.graphview.GraphView;
+import com.jjoe64.graphview.helper.GraphViewXML;
+import com.jjoe64.graphview.series.BarGraphSeries;
+import com.jjoe64.graphview.series.DataPoint;
+import com.jjoe64.graphview.series.DataPointInterface;
+import com.jjoe64.graphview.series.LineGraphSeries;
+import com.jjoe64.graphview.series.OnDataPointTapListener;
+import com.jjoe64.graphview.series.PointsGraphSeries;
+import com.jjoe64.graphview.series.Series;
+import com.jjoe64.graphview.utils.LogUtil;
import com.jjoe64.graphview_os.ResourceTable;
import com.jjoe64.graphview_os.base.BaseAbilitySlice;
import ohos.agp.components.Button;
@@ -84,7 +84,7 @@ public class MainAbilitySlice extends BaseAbilitySlice {
// }
//
// mIndex += 1;
- test7();
+ test9();
}
});
@@ -203,4 +203,33 @@ public class MainAbilitySlice extends BaseAbilitySlice {
graphView.getSecondScale().setVerticalAxisTitle("Sai SecondScale");
graphView.getSecondScale().setVerticalAxisTitleTextSize(-1);
}
+
+ private void test8(){
+ PointsGraphSeries seriesNew = new PointsGraphSeries<>(new DataPoint[]{
+ new DataPoint(0, 1),
+ new DataPoint(1, 5),
+ new DataPoint(2, 3),
+ new DataPoint(3, 2),
+ new DataPoint(4, 6)
+ });
+ graphView.addSeries(seriesNew);
+ graphView.getGridLabelRenderer().setHorizontalAxisTitle("Sai Horizontal");
+ graphView.getGridLabelRenderer().setVerticalAxisTitle("Sai Vertical");
+ graphView.getGridLabelRenderer().setTextSize(35.5f);
+ }
+
+ private void test9(){
+ BarGraphSeries series = new BarGraphSeries<>(new DataPoint[]{
+ new DataPoint(0, 1),
+ new DataPoint(1, 5),
+ new DataPoint(2, 3),
+ new DataPoint(3, 2),
+ new DataPoint(4, 6)
+ });
+ graphView.addSeries(series);
+ series.setTitle("Bar");
+ graphView.getLegendRenderer().setVisible(true);
+ graphView.getLegendRenderer().setFixedPosition(583,90);
+ graphView.getLegendRenderer().setMargin(30);
+ }
}
diff --git a/entry/src/main/java/com/jjoe64/graphview_os/utils/LogUtil.java b/entry/src/main/java/com/jjoe64/graphview_os/utils/LogUtil.java
index 7a95d37a90ed1ba5204fa7279bfd880358b439ef..a09fbf1028f1452a0ccc4d9a0c164c1c5f4a58aa 100644
--- a/entry/src/main/java/com/jjoe64/graphview_os/utils/LogUtil.java
+++ b/entry/src/main/java/com/jjoe64/graphview_os/utils/LogUtil.java
@@ -1,37 +1,19 @@
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.jjoe64.graphview_os.utils;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
+
import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;
diff --git a/entry/src/main/java/com/jjoe64/graphview_os/utils/Toast.java b/entry/src/main/java/com/jjoe64/graphview_os/utils/Toast.java
index 0b3321e9eb6df62ac6fff90573084f348efa09bb..21508dbb90cf91c75bb3724b9fa2d068aa686d93 100644
--- a/entry/src/main/java/com/jjoe64/graphview_os/utils/Toast.java
+++ b/entry/src/main/java/com/jjoe64/graphview_os/utils/Toast.java
@@ -1,37 +1,19 @@
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package com.jjoe64.graphview_os.utils;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
+
import ohos.agp.window.dialog.ToastDialog;
import ohos.app.Context;
diff --git a/entry/src/main/resources/base/layout/ability_main.xml b/entry/src/main/resources/base/layout/ability_main.xml
index 7de48d46e88cee7f68381412d99ea3468ba775d5..1bc1a7b27e6bbd2bc8cae286bfcf7f6b598992d0 100644
--- a/entry/src/main/resources/base/layout/ability_main.xml
+++ b/entry/src/main/resources/base/layout/ability_main.xml
@@ -13,19 +13,19 @@
ohos:text_color="#ffffff"
ohos:background_element="#000000"
ohos:text="test"/>
-
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/graphveiw/src/main/config.json b/graphveiw/src/main/config.json
index a8270a0c59f0ae9e34e2fd91bb11ebf965ca7cf7..9a5b9f358500fb60994f12537d08c49815d6dba1 100644
--- a/graphveiw/src/main/config.json
+++ b/graphveiw/src/main/config.json
@@ -14,7 +14,7 @@
},
"deviceConfig": {},
"module": {
- "package": "com.jjoe64.graphveiw",
+ "package": "com.jjoe64.graphview",
"deviceType": [
"tv"
],
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/test/TestView.java b/graphveiw/src/main/java/com/jjoe64/graphveiw/test/TestView.java
deleted file mode 100644
index c5a3153d55dfb0af2928ebd66d0c89d2fe5fef24..0000000000000000000000000000000000000000
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/test/TestView.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package com.jjoe64.graphveiw.test;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
-import ohos.agp.components.AttrSet;
-import ohos.agp.components.Component;
-import ohos.agp.render.Canvas;
-import ohos.app.Context;
-import ohos.multimodalinput.event.TouchEvent;
-
-public class TestView extends Component implements Component.DrawTask , Component.TouchEventListener{
- public TestView(Context context) {
- super(context);
- }
-
- public TestView(Context context, AttrSet attrSet) {
- super(context, attrSet);
- }
-
- public TestView(Context context, AttrSet attrSet, String styleName) {
- super(context, attrSet, styleName);
- }
-
- public TestView(Context context, AttrSet attrSet, int resId) {
- super(context, attrSet, resId);
-
- }
-
- @Override
- public void onDraw(Component component, Canvas canvas) {
-
- }
-
-
- @Override
- public boolean onTouchEvent(Component component, TouchEvent touchEvent) {
- return false;
- }
-}
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/AttrSetString.java b/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/AttrSetString.java
deleted file mode 100644
index 914fb1618e8501ee5ff3af4cdc685321efcafd2a..0000000000000000000000000000000000000000
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/AttrSetString.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.jjoe64.graphveiw.utils;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
-public class AttrSetString {
- public static String GRAPH_VIEW_SERIES_DATA="seriesData";
- public static String GRAPH_VIEW_SERIES_TYPE="seriesType";
- public static String GRAPH_VIEW_SERIES_COLOR="seriesColor";
- public static String GRAPH_VIEW_SERIES_TITLE="seriesTitle";
- public static String GRAPH_VIEW_TITLE="title";
-}
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/CursorMode.java b/graphveiw/src/main/java/com/jjoe64/graphview/CursorMode.java
similarity index 97%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/CursorMode.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/CursorMode.java
index 5bfc4591fa04679e0a17fa73baf99b5edc04fa91..cb8c250cfc65c4418161867f10d66ddf9841ef8a 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/CursorMode.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/CursorMode.java
@@ -1,8 +1,8 @@
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.series.BaseSeries;
-import com.jjoe64.graphveiw.series.DataPointInterface;
-import com.jjoe64.graphveiw.series.Series;
+import com.jjoe64.graphview.series.BaseSeries;
+import com.jjoe64.graphview.series.DataPointInterface;
+import com.jjoe64.graphview.series.Series;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.utils.Color;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/DefaultLabelFormatter.java b/graphveiw/src/main/java/com/jjoe64/graphview/DefaultLabelFormatter.java
similarity index 99%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/DefaultLabelFormatter.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/DefaultLabelFormatter.java
index 3cd935b3966c83aec90a86b6189c31b12ad380a7..fdde0b73483153d8cf4e7c0ae9a1bda67851e5c2 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/DefaultLabelFormatter.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/DefaultLabelFormatter.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
import java.text.NumberFormat;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/GraphView.java b/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java
similarity index 96%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/GraphView.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java
index f7d498fd3b4caa1ae2c39717d7cff00ceca03994..45d8b1f5d89edc2c790079ad85fcd0d3c5122c61 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/GraphView.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/GraphView.java
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.series.BaseSeries;
-import com.jjoe64.graphveiw.series.Series;
+import com.jjoe64.graphview.series.BaseSeries;
+import com.jjoe64.graphview.series.Series;
-import com.jjoe64.graphveiw.utils.LogUtil;
-import com.jjoe64.graphveiw.utils.PointF;
+import com.jjoe64.graphview.utils.LogUtil;
+import com.jjoe64.graphview.utils.PointF;
import ohos.agp.components.AttrSet;
import ohos.agp.components.Component;
import ohos.agp.render.Canvas;
@@ -580,16 +580,6 @@ public class GraphView extends Component implements Component.DrawTask, Componen
onDataChanged(false, false);
}
- /**
- * takes a snapshot, stores it and open the share dialog.
- * Notice that you need the permission .permission.WRITE_EXTERNAL_STORAGE
- *
- * @param context
- * @param imageName
- * @param title
- */
- public void takeSnapshotAndShare(Context context, String imageName, String title) {
- }
/**
* ss
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/GridLabelRenderer.java b/graphveiw/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java
similarity index 99%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/GridLabelRenderer.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java
index 9b0731e796d603730270dd82ecc5da8606351970..de79c6b575c3c776541d9f786374ee87832ed9b3 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/GridLabelRenderer.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/GridLabelRenderer.java
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.utils.LogUtil;
+import com.jjoe64.graphview.utils.LogUtil;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.utils.Color;
@@ -656,7 +656,6 @@ public class GridLabelRenderer {
numVerticalLabels = (int) ((mGraphView.getSecondScale().mCurrentViewport.height() * -1 / exactSteps)) + 2;
// ensure that the value is valid (minimum 2)
- // see https://github.com/appsthatmatter/GraphView/issues/520
numVerticalLabels = Math.max(numVerticalLabels, 2);
if (mStepsVerticalSecondScale != null) {
@@ -991,7 +990,7 @@ public class GridLabelRenderer {
// test label with first and last label
String testLabel = mLabelFormatter.formatLabel(mGraphView.getViewport().getMaxY(false), false);
if (testLabel == null) testLabel = "";
-
+ LogUtil.error("calcLabelVerticalSize--1->",testLabel);
Rect textBounds = new Rect();
mPaintLabel.getTextBounds(testLabel);
mLabelVerticalWidth = textBounds.getWidth();
@@ -999,7 +998,7 @@ public class GridLabelRenderer {
testLabel = mLabelFormatter.formatLabel(mGraphView.getViewport().getMinY(false), false);
if (testLabel == null) testLabel = "";
-
+ LogUtil.error("calcLabelVerticalSize--2->",testLabel);
mPaintLabel.getTextBounds(testLabel);
mLabelVerticalWidth = Math.max(mLabelVerticalWidth, textBounds.getWidth());
@@ -1256,6 +1255,7 @@ public class GridLabelRenderer {
// multiline labels
String label = mLabelFormatter.formatLabel(e.getValue(), true);
+ LogUtil.error("yuxh--horizontalLabel--->",label+"~~~"+e.getValue());
if (label == null) {
label = "";
}
@@ -1275,15 +1275,15 @@ public class GridLabelRenderer {
if (mStyles.horizontalLabelsAngle > 0 && mStyles.horizontalLabelsAngle < 90f) {
canvas.save();
canvas.rotate(mStyles.horizontalLabelsAngle, x + labelWidthAdj, y);
- canvas.drawText(mPaintLabel, lines[li], x + labelWidthAdj, y);
+ canvas.drawText(mPaintLabel, lines[li], x + labelWidthAdj-20, y);
canvas.restore();
} else if (mStyles.horizontalLabelsAngle > 0 && mStyles.horizontalLabelsAngle <= 180f) {
canvas.save();
canvas.rotate(mStyles.horizontalLabelsAngle - 180f, x - labelWidthAdj, y);
- canvas.drawText(mPaintLabel, lines[li], x - labelWidthAdj, y);
+ canvas.drawText(mPaintLabel, lines[li], x - labelWidthAdj-20, y);
canvas.restore();
} else {
- canvas.drawText(mPaintLabel, lines[li], x-5, y);
+ canvas.drawText(mPaintLabel, lines[li], x-20, y);
}
}
}
@@ -1304,9 +1304,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(getVerticalLabelsSecondScaleColor()));
//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();
@@ -1384,7 +1383,8 @@ public class GridLabelRenderer {
float y = posY;
- String label = mLabelFormatter.formatLabel(e.getValue(), false);
+ String label = mLabelFormatter.formatLabel(e.getValue().intValue(), false);
+ LogUtil.error("yuxh--verticalLabel--->",label+"~~~"+e.getValue().intValue());
if (label == null) {
label = "";
}
@@ -1400,7 +1400,6 @@ public class GridLabelRenderer {
y += (lines.length * getTextSize() * 1.1f) + 5;
break;
}
-
for (int li = 0; li < lines.length; li++) {
// for the last line y = height
float y2 = y - (lines.length - li - 1) * getTextSize() * 1.1f;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/LabelFormatter.java b/graphveiw/src/main/java/com/jjoe64/graphview/LabelFormatter.java
similarity index 98%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/LabelFormatter.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/LabelFormatter.java
index 11b9e566cde4ed516d036f849a80df945b0f0589..2f14bcf25c671f242c91dfb5263a48a6b38c5489 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/LabelFormatter.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/LabelFormatter.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
/**
* Interface to use as label formatter.
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/LegendRenderer.java b/graphveiw/src/main/java/com/jjoe64/graphview/LegendRenderer.java
similarity index 98%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/LegendRenderer.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/LegendRenderer.java
index 7189234812980635b025a5b9981f39fd2147586e..a016196dca53e1e298c12ae3e70c40cc7f7beb9c 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/LegendRenderer.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/LegendRenderer.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.series.Series;
-import com.jjoe64.graphveiw.utils.Point;
+import com.jjoe64.graphview.series.Series;
+import com.jjoe64.graphview.utils.Point;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.utils.Color;
@@ -185,7 +185,7 @@ public class LegendRenderer {
float lTop;
if (mStyles.fixedPosition != null) {
// use fied position
- lLeft = mGraphView.getGraphContentLeft() + mStyles.margin + mStyles.fixedPosition.x-50;
+ lLeft = mGraphView.getGraphContentLeft() + mStyles.margin + mStyles.fixedPosition.x;
lTop = mGraphView.getGraphContentTop() + mStyles.margin + mStyles.fixedPosition.y;
} else {
lLeft = mGraphView.getGraphContentLeft() + mGraphView.getGraphContentWidth() - legendWidth - mStyles.margin;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/RectD.java b/graphveiw/src/main/java/com/jjoe64/graphview/RectD.java
similarity index 95%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/RectD.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/RectD.java
index 196b20ae0e9da05be932768430fccdab14908d92..4d00a9f832ef85f14d21c50067e7d45932506a30 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/RectD.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/RectD.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.utils.RectF;
+import com.jjoe64.graphview.utils.RectF;
/**
* Created by jonas on 05.06.16.
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/SecondScale.java b/graphveiw/src/main/java/com/jjoe64/graphview/SecondScale.java
similarity index 99%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/SecondScale.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/SecondScale.java
index f7254f0fbef639c69f7e46440e6973f84c8dd15d..0adae062e1d19c10cc5b3b301f0e8d0e1cca36af 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/SecondScale.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/SecondScale.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.series.Series;
+import com.jjoe64.graphview.series.Series;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.utils.Color;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/UniqueLegendRenderer.java b/graphveiw/src/main/java/com/jjoe64/graphview/UniqueLegendRenderer.java
similarity index 93%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/UniqueLegendRenderer.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/UniqueLegendRenderer.java
index 1373091a93e6dfcd5e43e867febfbe67a026075f..610255fb465d0260f1e028ed079c15b7ed878a2b 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/UniqueLegendRenderer.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/UniqueLegendRenderer.java
@@ -1,6 +1,6 @@
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.series.Series;
+import com.jjoe64.graphview.series.Series;
import ohos.utils.Pair;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/ValueDependentColor.java b/graphveiw/src/main/java/com/jjoe64/graphview/ValueDependentColor.java
similarity index 92%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/ValueDependentColor.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/ValueDependentColor.java
index 4f848f936b416e68868fc04e2155653af7dbf644..eccce69434b642a6e5596773da67d30dcb8a358c 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/ValueDependentColor.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/ValueDependentColor.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.series.DataPointInterface;
+import com.jjoe64.graphview.series.DataPointInterface;
/**
* you can change the color depending on the value.
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/Viewport.java b/graphveiw/src/main/java/com/jjoe64/graphview/Viewport.java
similarity index 99%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/Viewport.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/Viewport.java
index e1f1fda52d3b99f71c8581ad242f0a10c6b43d04..4dcf918d60a43a4a1313b8fb3b5696e468be237d 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/Viewport.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/Viewport.java
@@ -14,11 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw;
+package com.jjoe64.graphview;
-import com.jjoe64.graphveiw.series.DataPointInterface;
-import com.jjoe64.graphveiw.series.Series;
-import com.jjoe64.graphveiw.utils.LogUtil;
+import com.jjoe64.graphview.series.DataPointInterface;
+import com.jjoe64.graphview.series.Series;
+import com.jjoe64.graphview.utils.LogUtil;
import ohos.agp.components.ScrollHelper;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/compat/OverScrollerCompat.java b/graphveiw/src/main/java/com/jjoe64/graphview/compat/OverScrollerCompat.java
similarity index 96%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/compat/OverScrollerCompat.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/compat/OverScrollerCompat.java
index 06dd3a1036d498a113174758bb4fa7f373475a13..8fa61b1c4a7fb4401afe53a7095ddf73b2a79a96 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/compat/OverScrollerCompat.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/compat/OverScrollerCompat.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.compat;
+package com.jjoe64.graphview.compat;
import ohos.agp.components.ScrollHelper;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/helper/DateAsXAxisLabelFormatter.java b/graphveiw/src/main/java/com/jjoe64/graphview/helper/DateAsXAxisLabelFormatter.java
similarity index 96%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/helper/DateAsXAxisLabelFormatter.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/helper/DateAsXAxisLabelFormatter.java
index c163ae4b22f82fe19777057cda331b562a956723..bab0f72d762d37b8836fa156b1ff0d2daef7c0fa 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/helper/DateAsXAxisLabelFormatter.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/helper/DateAsXAxisLabelFormatter.java
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.helper;
+package com.jjoe64.graphview.helper;
-import com.jjoe64.graphveiw.DefaultLabelFormatter;
+import com.jjoe64.graphview.DefaultLabelFormatter;
import ohos.app.Context;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/helper/GraphViewXML.java b/graphveiw/src/main/java/com/jjoe64/graphview/helper/GraphViewXML.java
similarity index 90%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/helper/GraphViewXML.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/helper/GraphViewXML.java
index 08d0a646598830f005b5b5f3809b1a0c9155a7d4..5c703b16bda1ec73199d9b6f6ccf9c03e8c5a010 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/helper/GraphViewXML.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/helper/GraphViewXML.java
@@ -14,16 +14,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.helper;
+package com.jjoe64.graphview.helper;
-import com.jjoe64.graphveiw.GraphView;
-import com.jjoe64.graphveiw.series.*;
-import com.jjoe64.graphveiw.utils.LogUtil;
+import com.jjoe64.graphview.GraphView;
+import com.jjoe64.graphview.series.*;
+import com.jjoe64.graphview.utils.LogUtil;
import ohos.agp.components.AttrSet;
import ohos.agp.utils.Color;
import ohos.app.Context;
-import static com.jjoe64.graphveiw.utils.AttrSetString.*;
+import static com.jjoe64.graphview.utils.AttrSetString.*;
/**
@@ -54,11 +54,11 @@ import static com.jjoe64.graphveiw.utils.AttrSetString.*;
* @author jjoe64
*/
public class GraphViewXML extends GraphView {
- private String dataStr = "0=1;1=3;2=1;3=3";
- private Color color = new Color(0xff000000);
+ private String dataStr = "";
+ private Color color = new Color(Color.getIntColor("#1E90FF"));
private String type = "line";
- private String seriesTitle = "test1";
- private String title = "test";
+ private String seriesTitle = "";
+ private String title = "";
/**
* creates the graphview object with data and
@@ -113,6 +113,7 @@ public class GraphViewXML extends GraphView {
} else if (type.equals("points")) {
series = new PointsGraphSeries(data);
} else {
+ LogUtil.error("unknown graph type: " + type , ". Possible is line|bar|points");
throw new IllegalArgumentException("unknown graph type: " + type + ". Possible is line|bar|points");
}
if (color.getValue() != 0) {
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/helper/StaticLabelsFormatter.java b/graphveiw/src/main/java/com/jjoe64/graphview/helper/StaticLabelsFormatter.java
similarity index 93%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/helper/StaticLabelsFormatter.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/helper/StaticLabelsFormatter.java
index 12c84e84f889aab202a6abef8bbfa2c2dac87ecd..eddebdf59d09d59e498167fd2360bd8c68f4d35f 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/helper/StaticLabelsFormatter.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/helper/StaticLabelsFormatter.java
@@ -14,13 +14,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.helper;
+package com.jjoe64.graphview.helper;
-import com.jjoe64.graphveiw.DefaultLabelFormatter;
-import com.jjoe64.graphveiw.GraphView;
-import com.jjoe64.graphveiw.LabelFormatter;
-import com.jjoe64.graphveiw.Viewport;
+import com.jjoe64.graphview.DefaultLabelFormatter;
+import com.jjoe64.graphview.GraphView;
+import com.jjoe64.graphview.LabelFormatter;
+import com.jjoe64.graphview.Viewport;
+import com.jjoe64.graphview.utils.LogUtil;
/**
* Use this label formatter to show static labels.
@@ -190,6 +191,8 @@ public class StaticLabelsFormatter implements LabelFormatter {
double range = maxX - minX;
value = value-minX;
int idx = (int)((value/range) * (mHorizontalLabels.length-1));
+ LogUtil.error("formatLabel=mHorizontalLabels==>","value = "+value+"; minX = "+minX+"; maxX"+maxX+"; range = "+range+"; idx = "+idx+"; mVerticalLabels.length = "+mVerticalLabels.length+";");
+
return mHorizontalLabels[idx];
} else if (!isValueX && mVerticalLabels != null) {
double minY = mViewport.getMinY(false);
@@ -197,6 +200,7 @@ public class StaticLabelsFormatter implements LabelFormatter {
double range = maxY - minY;
value = value-minY;
int idx = (int)((value/range) * (mVerticalLabels.length-1));
+ LogUtil.error("formatLabel=mVerticalLabels==>","value = "+value+"; minY = "+minY+"; maxY"+maxY+"; range = "+range+"; idx = "+idx+"; mVerticalLabels.length = "+mVerticalLabels.length+";");
return mVerticalLabels[idx];
} else {
return mDynamicLabelFormatter.formatLabel(value, isValueX);
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/BarGraphSeries.java b/graphveiw/src/main/java/com/jjoe64/graphview/series/BarGraphSeries.java
similarity index 99%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/series/BarGraphSeries.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/series/BarGraphSeries.java
index 63be30ed1b2fea738df3c992bb27b514566a2a66..14938d8ce1d782d294e63edbe4d6c83f95963ebc 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/BarGraphSeries.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/series/BarGraphSeries.java
@@ -14,11 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.series;
+package com.jjoe64.graphview.series;
-import com.jjoe64.graphveiw.GraphView;
-import com.jjoe64.graphveiw.RectD;
-import com.jjoe64.graphveiw.ValueDependentColor;
+import com.jjoe64.graphview.GraphView;
+import com.jjoe64.graphview.RectD;
+import com.jjoe64.graphview.ValueDependentColor;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.utils.Color;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/BaseSeries.java b/graphveiw/src/main/java/com/jjoe64/graphview/series/BaseSeries.java
similarity index 99%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/series/BaseSeries.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/series/BaseSeries.java
index f9b5e2f36f6382470572749b07ac349f1015aed0..f3f57d6976b33c6e5a2a5b1028ae24b4333cc10b 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/BaseSeries.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/series/BaseSeries.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.series;
+package com.jjoe64.graphview.series;
-import com.jjoe64.graphveiw.GraphView;
-import com.jjoe64.graphveiw.utils.PointF;
+import com.jjoe64.graphview.GraphView;
+import com.jjoe64.graphview.utils.PointF;
import ohos.agp.render.Canvas;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/DataPoint.java b/graphveiw/src/main/java/com/jjoe64/graphview/series/DataPoint.java
similarity index 97%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/series/DataPoint.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/series/DataPoint.java
index 37ca6d12c1f9aea35d7415dc43b9887c8aec5c6f..07b5716184ea1a20a9aa4e0126dcb905381f4423 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/DataPoint.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/series/DataPoint.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.series;
+package com.jjoe64.graphview.series;
import java.io.Serializable;
import java.util.Date;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/DataPointInterface.java b/graphveiw/src/main/java/com/jjoe64/graphview/series/DataPointInterface.java
similarity index 96%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/series/DataPointInterface.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/series/DataPointInterface.java
index 2857f78230e7247088de9b87c22b81e85661809e..0ef5370610423f57b796484b0db22cc443dbc78d 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/DataPointInterface.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/series/DataPointInterface.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.series;
+package com.jjoe64.graphview.series;
/**
* interface of data points. Implement this in order
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/LineGraphSeries.java b/graphveiw/src/main/java/com/jjoe64/graphview/series/LineGraphSeries.java
similarity index 99%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/series/LineGraphSeries.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/series/LineGraphSeries.java
index ce4220fad41e1aa5dc6473f3a5b13c4375845240..12620dec3231ddcee71073bcad0850b5f8b845ad 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/LineGraphSeries.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/series/LineGraphSeries.java
@@ -14,9 +14,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.series;
+package com.jjoe64.graphview.series;
-import com.jjoe64.graphveiw.GraphView;
+import com.jjoe64.graphview.GraphView;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.render.Path;
@@ -533,7 +533,6 @@ public class LineGraphSeries extends BaseSeries
private void renderLine(Canvas canvas, float[] pts, Paint paint) {
if (pts.length == 4 && pts[0] == pts[2] && pts[1] == pts[3]) {
// avoid zero length lines, to makes troubles on some devices
- // see https://github.com/appsthatmatter/GraphView/issues/499
return;
}
canvas.drawLines(pts, paint);
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/OnDataPointTapListener.java b/graphveiw/src/main/java/com/jjoe64/graphview/series/OnDataPointTapListener.java
similarity index 96%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/series/OnDataPointTapListener.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/series/OnDataPointTapListener.java
index 5d76b71323acc2cba704f48aad8f8ec0b5e3c12c..e094e49fd00b3ab592ed7814f3cb430f121645d8 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/OnDataPointTapListener.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/series/OnDataPointTapListener.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.series;
+package com.jjoe64.graphview.series;
/**
* Listener for the tap event which will be
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/PointsGraphSeries.java b/graphveiw/src/main/java/com/jjoe64/graphview/series/PointsGraphSeries.java
similarity index 98%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/series/PointsGraphSeries.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/series/PointsGraphSeries.java
index 57dcb919cd7ab13d473477a4e404622b1d3e42c9..49ae75a54fc787dad7b752ce6a8c56b1e76a3671 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/PointsGraphSeries.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/series/PointsGraphSeries.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.series;
+package com.jjoe64.graphview.series;
-import com.jjoe64.graphveiw.GraphView;
-import com.jjoe64.graphveiw.utils.Point;
+import com.jjoe64.graphview.GraphView;
+import com.jjoe64.graphview.utils.Point;
import ohos.agp.render.Canvas;
import ohos.agp.render.Paint;
import ohos.agp.render.Path;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/Series.java b/graphveiw/src/main/java/com/jjoe64/graphview/series/Series.java
similarity index 97%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/series/Series.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/series/Series.java
index 5c91cfba4b7ae1a0c3bd5224f953f6396dd16b26..d09015e6b5b00a6235f273d6fd608710be1b2efc 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/series/Series.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/series/Series.java
@@ -14,13 +14,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.jjoe64.graphveiw.series;
+package com.jjoe64.graphview.series;
-import com.jjoe64.graphveiw.GraphView;
+import com.jjoe64.graphview.GraphView;
import ohos.agp.render.Canvas;
import java.util.Iterator;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphview/test/TestView.java b/graphveiw/src/main/java/com/jjoe64/graphview/test/TestView.java
new file mode 100644
index 0000000000000000000000000000000000000000..7e6df85c289fcd3f43e6b78e30a85398ba3e0892
--- /dev/null
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/test/TestView.java
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jjoe64.graphview.test;
+
+import ohos.agp.components.AttrSet;
+import ohos.agp.components.Component;
+import ohos.agp.render.Canvas;
+import ohos.app.Context;
+import ohos.multimodalinput.event.TouchEvent;
+
+public class TestView extends Component implements Component.DrawTask , Component.TouchEventListener{
+ public TestView(Context context) {
+ super(context);
+ }
+
+ public TestView(Context context, AttrSet attrSet) {
+ super(context, attrSet);
+ }
+
+ public TestView(Context context, AttrSet attrSet, String styleName) {
+ super(context, attrSet, styleName);
+ }
+
+ public TestView(Context context, AttrSet attrSet, int resId) {
+ super(context, attrSet, resId);
+
+ }
+
+ @Override
+ public void onDraw(Component component, Canvas canvas) {
+
+ }
+
+
+ @Override
+ public boolean onTouchEvent(Component component, TouchEvent touchEvent) {
+ return false;
+ }
+}
diff --git a/graphveiw/src/main/java/com/jjoe64/graphview/utils/AttrSetString.java b/graphveiw/src/main/java/com/jjoe64/graphview/utils/AttrSetString.java
new file mode 100644
index 0000000000000000000000000000000000000000..186591e073ff0483631a60506ba33601cbfdd2e5
--- /dev/null
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/utils/AttrSetString.java
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jjoe64.graphview.utils;
+
+public class AttrSetString {
+ public static String GRAPH_VIEW_SERIES_DATA="seriesData";
+ public static String GRAPH_VIEW_SERIES_TYPE="seriesType";
+ public static String GRAPH_VIEW_SERIES_COLOR="seriesColor";
+ public static String GRAPH_VIEW_SERIES_TITLE="seriesTitle";
+ public static String GRAPH_VIEW_TITLE="title";
+}
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/LogUtil.java b/graphveiw/src/main/java/com/jjoe64/graphview/utils/LogUtil.java
similarity index 35%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/utils/LogUtil.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/utils/LogUtil.java
index b308be222d3f635146229b8c9fe15dc96e48b530..d4ee6436b94572e8428aacd897660774b64959b5 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/LogUtil.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/utils/LogUtil.java
@@ -1,37 +1,19 @@
-package com.jjoe64.graphveiw.utils;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jjoe64.graphview.utils;
+
import ohos.hiviewdfx.HiLog;
import ohos.hiviewdfx.HiLogLabel;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/Point.java b/graphveiw/src/main/java/com/jjoe64/graphview/utils/Point.java
similarity index 30%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/utils/Point.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/utils/Point.java
index ce2db303acb3301434cd8dd1dda078a2a6ac87cb..c207013e673309818fea3ff5c219b8c2dd8402c2 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/Point.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/utils/Point.java
@@ -1,37 +1,19 @@
-package com.jjoe64.graphveiw.utils;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jjoe64.graphview.utils;
+
public class Point {
public int x;
public int y;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/PointF.java b/graphveiw/src/main/java/com/jjoe64/graphview/utils/PointF.java
similarity index 39%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/utils/PointF.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/utils/PointF.java
index eaa145ba5ff39748c6a4384bf4d6180e9d451352..026101827f77fa4bd85eb133f870da1bd48f78e2 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/PointF.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/utils/PointF.java
@@ -1,38 +1,19 @@
-package com.jjoe64.graphveiw.utils;
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jjoe64.graphview.utils;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
public class PointF {
public float x;
public float y;
diff --git a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/RectF.java b/graphveiw/src/main/java/com/jjoe64/graphview/utils/RectF.java
similarity index 83%
rename from graphveiw/src/main/java/com/jjoe64/graphveiw/utils/RectF.java
rename to graphveiw/src/main/java/com/jjoe64/graphview/utils/RectF.java
index e2aadb5373332de14fc39cc7fe61f2432cfbb9d4..5ec7d10941141cc5e2a5a2a835ed72dfbe8a1e4e 100644
--- a/graphveiw/src/main/java/com/jjoe64/graphveiw/utils/RectF.java
+++ b/graphveiw/src/main/java/com/jjoe64/graphview/utils/RectF.java
@@ -1,37 +1,19 @@
-package com.jjoe64.graphveiw.utils;
-/*----------------------------------------------------------------------------
- * Copyright (c) <2013-2018>,
- * All rights reserved.
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- * 1. Redistributions of source code must retain the above copyright notice, this list of
- * conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright notice, this list
- * of conditions and the following disclaimer in the documentation and/or other materials
- * provided with the distribution.
- * 3. Neither the name of the copyright holder nor the names of its contributors may be used
- * to endorse or promote products derived from this software without specific prior written
- * permission.
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
- * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
- * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *---------------------------------------------------------------------------*/
-/*----------------------------------------------------------------------------
- * Notice of Export Control Law
- * ===============================================
- * Huawei LiteOS may be subject to applicable export control laws and regulations, which might
- * include those applicable to Huawei LiteOS of U.S. and the country in which you are located.
- * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such
- * applicable export control laws and regulations.
- *---------------------------------------------------------------------------*/
+/*
+ * Copyright (C) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.jjoe64.graphview.utils;
+
import ohos.agp.utils.Rect;
import ohos.utils.Parcel;
diff --git a/image/demo1.gif b/image/demo1.gif
new file mode 100644
index 0000000000000000000000000000000000000000..513417ea616ba94d15fea3285d89fbd5224ab3f7
Binary files /dev/null and b/image/demo1.gif differ