最近项目中用到了很多的图表,如柱状图,线状图,饼状图等等。接触到了一个新的第三方Charts,在做图方面确实非常强大,在使用了一段时间后,今天对他进行一个小的总结,也是自己的一点小理解。

关于charts图的基本的创建与一些基本的属性就不多一一赘述了,下面说一下我平时用到的,大家可能理解不太深刻的一些属性与用法。

(在这里说一下,各种图的属性用法相似,我就不一一区分写了,这篇文章针对的是一些对Charts有一定了解的人,自然也是能看懂的。)

    1.网格的形式:gridLineDashLengths = @[@3.0f,@3.0f] 网格线长度 网格线间的间隔 (如果想要实线只需要把数组后一个改成0.0f)

  2.X轴上数据的显示:vauleFormatter 可自定义;granularity 刻度  =1时可防止因放大X轴引起的数据刻度变小。 也可理解为隔几个显示一个数值

  3.默认选中:

    [priceLineChartView highlightValueWithX:DateNameArray.count - 1 y:[LineDataArray.lastObject floatValue]  dataSetIndex:0];

  4.多柱图的设置: BarChartData *data = [[BarChartData alloc] initWithDataSets:dataSets];

          data.barWidth = 0.28;

           [data groupBarsFromX:-0.5 groupSpace:0.1 barSpace:0.02];

  5.选中叠加柱时,弹出MarkView的值的显示:

open override func refreshContent(entry: ChartDataEntry, highlight: Highlight)

{

let indexNum:Int = highlight.stackIndex

let barEntry:BarChartDataEntry = entry as! BarChartDataEntry

if indexNum == -1 {

let yVal = String (format: "%.2f", barEntry.y)

setLabel(yVal)

}else {

let yVal = String (format: "%.2f", barEntry.yValues![indexNum])

setLabel(yVal)

}

}

  6.默认移动到特定位置:

  

    [priceLineChartView moveViewToAnimatedWithXValue:[priceLineChartView.data entryCount]-1  yValue:[priceLineChartView.data dataSetCount]-1     axis:AxisDependencyLeft duration:0.01];

  7.放大Charts:

    [priceLineChartView.viewPortHandler refreshWithNewMatrix:CGAffineTransformMakeScale(a * 1.3, 1.0) chart:priceLineChartView invalidate:YES];

   暂时就想到这么多,有更好的需要添加的我会持续整理,有什么问题也可以加我QQ530910944大家交流一下。

关于图表第三方Charts的一些理解与总结的更多相关文章

  1. iOS 图表工具charts之CombinedChartView

    关于charts的系列视图介绍传送门: iOS 图表工具charts介绍 iOS 图表工具charts之LineChartView iOS 图表工具charts之BarChartView iOS 图表 ...

  2. iOS 图表工具charts之CandleStickChartView(K线)

    关于charts的系列视图介绍传送门: iOS 图表工具charts介绍 iOS 图表工具charts之LineChartView iOS 图表工具charts之BarChartView iOS 图表 ...

  3. iOS 图表工具charts之PieChartView

    关于charts的系列视图介绍传送门: iOS 图表工具charts介绍 iOS 图表工具charts之LineChartView iOS 图表工具charts之BarChartView iOS 图表 ...

  4. iOS 图表工具charts之BarChartView

    关于charts的系列视图介绍传送门: iOS 图表工具charts介绍 iOS 图表工具charts之LineChartView iOS 图表工具charts之BarChartView iOS 图表 ...

  5. iOS 图表工具charts之LineChartView

    关于charts的系列视图介绍传送门: iOS 图表工具charts介绍 iOS 图表工具charts之LineChartView iOS 图表工具charts之BarChartView iOS 图表 ...

  6. 网页绘制图表 Google Charts with JavaScript #2 ....与ASP.NET网页结合 (ClientScriptManager.RegisterStartupScript 方法)

    此为文章备份,原文出处(我的网站) 网页绘制图表 Google Charts with JavaScript #2 ....与ASP.NET网页结合 (ClientScriptManager.Regi ...

  7. 网页绘制图表 Google Charts with JavaScript #1....好强、好简单啊!

    此为文章备份,原文出处(我的网站) 网页绘制图表 Google Charts with JavaScript....好强.好简单啊!#1 http://www.dotblogs.com.tw/mis2 ...

  8. iOS 图表工具charts介绍

    charts是一个很好的绘图工具,功能非常强大,可以用来绘制折线,柱状图,饼状图,k线图,k线分时图,雷达图,气泡图等等,charts是一款仿照安卓 MPAndroidChart而来的一个基于swif ...

  9. 第三方Charts绘制图表四种形式:饼状图,雷达图,柱状图,直线图

    对于第三方框架Charts(Swift版本,在OC项目中需要添加桥接头文件),首先要解决在项目中集成的问题,集成步骤: 一.下载Charts框架 下载地址:https://github.com/dan ...

随机推荐

  1. 64_p3

    perl-Locale-Msgfmt-0.15-17.fc26.noarch.rpm 12-Feb-2017 03:11 20558 perl-Locale-PO-0.27-6.fc26.noarch ...

  2. Python 类的名称空间和组合

    一.Python类的名称空间 class Student(object): School = '北京大学' def __init__(self): pass stu1 = Student() stu1 ...

  3. Delphi 中的自动释放策略

    来自万一老师的博客:http://www.cnblogs.com/del/archive/2011/12/21/2295794.html ------------------------------- ...

  4. HDU 2859 Phalanx(二维DP)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2859 题目大意:对称矩阵是这样的矩阵,它由“左下到右”线对称. 相应位置的元素应该相同. 例如,这里是 ...

  5. ubuntu 上 安装多个php版本

    Ubuntu上官方的源,比如 Ubuntu14.04 默认源中的是 PHP5.6.x.Ubuntu16.04 默认源中的是 PHP7.0.x,那么如果想在 Ubuntu16.04 上安装 PHP7.1 ...

  6. Asp.Net MVC4 之Url路由

    先来看下面两个个url,对比一下: http://xxx.yyy.com/Admin/UserManager.aspx http://xxx.yyy.com/Admin/DeleteUser/1001 ...

  7. 【PAT】1006. 换个格式输出整数 (15)

    1006. 换个格式输出整数 (15) 让我们用字母B来表示“百”.字母S表示“十”,用“12...n”来表示个位数字n(<10),换个格式来输出任一个不超过3位的正整数.例如234应该被输出为 ...

  8. 常用的scrapy setting

    原文请参考    Scrapy 爬虫入门教程十三 Settings(设置), 讲的很详细 官网参考  Settings 设置 Scrapy 设置允许您自定义所有 Scrapy 组件的行为,包括核心,扩 ...

  9. Python导入模块-Import

    #1语法importimport module1,module2,module3,module4 #2from xx import xx 语句from module import name1,name ...

  10. HTML框架与表单

    1.框架处理结构 <html> <head> <meta http-equiv="Content-Type" content="text/h ...