zoukankan      html  css  js  c++  java
  • [转]在iOS项目中使用CorePlot框架

    转载地址:http://blog.csdn.net/llfjfz/article/details/7849190#comments

    Core Plot是OS X和IOS下的一个开源图形库,它提供数据的可视化处理,就是画曲线图、柱状图和饼图等等。如何在项目中使用Core Plot的静态库呢?以下是几个步骤:

    首先先去Google Code下载Core Plot图形库,网址 http://code.google.com/p/core-plot/ 。目前该网址提供了CorePlot_1.0.zip下载,下载后解压。

    然后打开压缩包中的ReadMes文件中的“README for Static Library Install”文件,该文件内容如下:

    Install Binaries for iOS

    1. Copy the CorePlotHeaders to your Xcode project

    2. Copy libCorePlotCocoaTouch.a to your Xcode project

    3. Add to Other Linker Flags in your target build settings:

    -ObjC -all_load

    4. Add the QuartzCore framework to the project.

    5. Add a CPTGraph to your application. See the example apps in Source Code to see how, or read the documentation.

    其实如何使用CorePlot的静态库该文档说明的很清楚了,以下结合示意图说明如何操作。

    1.找到刚才压缩包中的"Binaries-->iOS"文件夹,把整个“CorePlotHeaders”文件夹拷贝到项目中,拷贝的时候记得选上“Copy items into destination group's folder(if need)”选项。

    2.把上述文件夹中的"libCorePlotCocoaTouch.a"拷贝到项目中,也选上“Copy items into destination group's folder(if need)”选项。

    3.项目目标的编译设置的“Other Linker Flags”选择项中加入  “-ObjC -all_load”

    完成以上几个步骤后大致如下图所示,注意画红线的地方:

    4.把“QuartzCore”框架加入项目中,操作如下:

    到此已经可以工作了,第5点实际上是针对编程的,告诉你要把图形画在“CPTGraph”上。具体的代码可以参考CorePlot压缩包自带examples, 其中在ios下有个例子比较有用:“CorePlotGallery” 。

  • 相关阅读:
    我的Ajax之旅(一):不能加载'AjaxControlToolkit'。。。拒绝访问
    网络编程(一):用C#下载网络文件的2种方法
    Locks
    Threads
    C语言中函数名和struct名可以重名!
    使用#include <pthread.h>
    APUE Chapter 7 (2)main函数的参数
    Creating a shared and static library with the gnu compiler [gcc][转]
    Signals
    APUE Chapter 7(3) – Memory layout of a C program
  • 原文地址:https://www.cnblogs.com/csshaw/p/3756053.html
Copyright © 2011-2022 走看看