简体   繁体   English

iOS中的CorePlot

[英]CorePlot in iOS

Till now, I have been using google charts and UIWebView to show graphs in my iPhone application. 到目前为止,我一直在使用Google图表和UIWebView在我的iPhone应用程序中显示图形。

I would like to start using CorePlot so that I do not need to be dependent on the internet connection to show my graphs. 我想开始使用CorePlot,这样我就不必依赖Internet连接来显示我的图表。 However, I am lost on how to use CorePlot for my applications. 但是,我不知道如何在我的应用程序中使用CorePlot。

Would someone be able to help me out with how I should use CorePlot? 有人能够帮助我如何使用CorePlot吗?

The official Core Plot documentation is out of date (on the wiki, on the google code site, AND the read me information downloaded with the project from github...). 官方的Core Plot文档已过期(在Wiki,Google代码站点上,以及从github下载与项目一起下载的自述信息...)。

Here are some current steps to follow to add the static Core Plot library to your project: 以下是将静态Core Plot库添加到项目中的一些当前步骤:

1) download the latest version of CorePlot here 1)在此处下载最新版本的CorePlot

2) navigate to the CorePlot framework folder and run CorePlot-CocoaTouch.xcodeproj 2)导航到CorePlot框架文件夹并运行CorePlot-CocoaTouch.xcodeproj

3) build (not run) the CorePlot-CocoaTouch.xcodeproj project 3)构建(不运行)CorePlot-CocoaTouch.xcodeproj项目

4) navigate back to your CorePlot download folder > build > Debug-iphoneos and verify libCorePlot-CocoaTouch.a has been created. 4)导航回到您的CorePlot下载文件夹> build> Debug-iphoneos并确认已创建libCorePlot-CocoaTouch.a。 If not, unzip the download and repeat steps 1-4 如果不是,请解压缩下载文件并重复步骤1-4

5) back in Xcode highlight the CorePlot-CocoaTouch project 5)回到Xcode中,突出显示CorePlot-CocoaTouch项目

6) click Product > Scheme > select Universal Library (selects which target to build) 6)单击产品>方案>选择通用库(选择要构建的目标)

7) build project again (not run) 7)重新建立专案(无法执行)

8) go BACK to your CorePlot download folder > build > Release-universal and you will see the CorePlotHeaders folder and libCorePlot-CocoaTouch.a are both available 8)返回到您的CorePlot下载文件夹>构建>发行版本,您将看到CorePlotHeaders文件夹和libCorePlot-CocoaTouch.a都可用

9) open the Xcode project you would like to add static CorePlot to 9)打开要添加静态CorePlot的Xcode项目

10) add the CorePlot > build > Release-universal > CorePlotHeaders folder and libCorePlot-CocoaTouch.a files to your project (selecting 'copy items into destination group's folder) 10)将CorePlot>构建>通用发布> CorePlotHeaders文件夹和libCorePlot-CocoaTouch.a文件添加到您的项目中(选择“将项目复制到目标组的文件夹中”)

11) select your Project and in the 'Linking' section find 'Other Linker Flags' and add '-ObjC' 11)选择您的项目,然后在“链接”部分中找到“其他链接器标志”并添加“ -ObjC”

12) from your Target > Build Phases > Link Binary With Libraries add the QuartzCore framework to your project 12)从“目标”>“构建阶段”>“使用库链接二进制文件”将QuartzCore框架添加到您的项目中

13) if libCorePlot-CocoaTouch.a is not in your Link Binary With Libraries list drag it from where you copied it to your project to the Library list to add it. 13)如果libCorePlot-CocoaTouch.a不在“使用库链接二进制”列表中,请将其从将其复制到项目的位置拖动到“库”列表中以添加它。

You should now be able to #import "CorePlot-CocoaTouch.h" (autocomplete) to the viewcontroller that you will be using to manage your CorePlot. 现在,您应该可以将“ CorePlot-CocoaTouch.h”(自动完成)导入到将用于管理CorePlot的视图控制器中。

If you are following old documentation on how to use CorePlot be aware that the new prefix is CPT (not CP, adjust accordingly) 如果您遵循有关如何使用CorePlot的旧文档,请注意新前缀是CPT(不是CP,请相应调整)

Happy coding! 编码愉快!

许多人将能够为您提供帮助,但您必须先开始做一些事情:)您是否检查了他们的Wiki

Check this tutorial featured by google code's site: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application 查看由Google Code网站推荐的本教程: http : //www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application

And this instructions are worth reading too: http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications 这些说明也值得一读: http : //code.google.com/p/core-plot/wiki/UsingCorePlotInApplications

Hope it helps! 希望能帮助到你!

Look through the example apps included with Core Plot. 浏览Core Plot随附的示例应用程序。 The Plot Gallery app (available for MacOS, iPhone, and iPad) shows examples of all of the supported plot types and demonstrates many Core Plot features. Plot Gallery应用程序(适用于MacOS,iPhone和iPad)显示了所有受支持的绘图类型的示例,并演示了许多Core Plot功能。

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

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