简体   繁体   English

Android:如何创建图形,尝试使用库并最终头痛

[英]Android: How to create graphs, tried using a library and ended up with a headache

I was wondering what the easiest way is to display a simple graph of any sort based on values that I already have. 我想知道最简单的方法是根据我已经拥有的值显示任何形式的简单图形。 I tried using a library but ended up with more errors than i can count. 我尝试使用一个库,但最终出现了超出我数数的错误。 What is the trick to using libraries and can someone take a second and help walk me through the steps because online all i can find is tutorials that just go: Download this jar. 使用库的诀窍是什么,有人可以花点时间帮助我完成这些步骤,因为我在网上只能找到直接可以使用的教程:下载此jar。 put it in libs and tah dah. 把它放在libs和tah dah中。 But I am not seeming to find such luck. 但是我似乎没有找到这样的运气。

Is there a way to download it as if it was a compelete project and then just import it? 有没有办法像下载一个完整项目一样下载它,然后将其导入? Or do you have to go through and pick out each little thing? 还是您必须经过挑选每个小事情?

Quoting the project documentation : 引用项目文档

  1. Recommended: If you use Gradle/Android Studio you can use the library from Maven Central. 推荐:如果您使用Gradle / Android Studio,则可以使用Maven Central中的库。 Add that line to your build.grade file into the dependencies block: 将该行添加到您的build.grade文件中的依赖关系块中:

    compile 'com.jjoe64:graphview:3.1.3'

  2. Download .jar file and copy it into the libs folder of your project. 下载.jar文件,然后将其复制到项目的libs文件夹中。 GraphView-3.1.3.jar GraphView-3.1.3.jar

  3. Download or clone the git repository and link your project with the GraphView library project. 下载或克隆git存储库,并将您的项目与GraphView库项目链接。 jjoe64/GraphView on GitHub GitHub上的jjoe64 / GraphView

Since you have the question tagged with , option #2 would seem to be the most likely choice. 由于您的问题用标记,因此选项#2似乎是最可能的选择。

Note that the author also provides: 请注意,作者还提供:

both of which may help you learn how to use it, as an adjunct to the rest of the documentation. 作为文档其余部分的补充,这两种方法都可以帮助您学习如何使用它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM