Select Page
Latest 0.0.5 https://github.com/CrystalMarch/CoordinateAxisChart MIT ios 8.0, requires ARC Foundation, UIKit Crystal

## Drawing graphs of point, linear function, power function, exponential function, logarithmic function, circular function, etc in a coordinate. （实现了在坐标系中画点，一次函数，幂函数，指数函数，对数函数，三角函数等）

### for instance:

• linear function(一次函数): yAxis = xAxis – 3
• power function(幂函数): yAxis = pow(xAxis, 2)
• exponential function(指数函数): yAxis = pow(2, xAxis)
• logarithmic function, xAxis should be greater than zero(对数函数, 此时应该设置axis的值大于0): yAxis = log (xAxis)
• circular function(三角函数), like sin, cos, tan: yAxis = sin (xAxis)

### Android version entrance

CoordinateAxisChart for Android

## Installation

### CocoaPods

Swift 3.0:

``````use_frameworks!
pod 'CoordinateAxisChart', '~> 0.0.5'``````

Note: To use Swift 3.x / master, you need Xcode 8+

To use master directly (it’s usually stable):

``pod 'CoordinateAxisChart', :git => 'https://github.com/CrystalMarch/CoordinateAxisChart.git'``

And then:

``pod install``

Import the framework in your code:

``import CoordinateAxisChart``

## Quick start

``````let chartView = CoordinateAxisChart()
chartView.frame = CGRect(x:50,y:50,width:220,height:220)
var pointData: [CGPoint] = []
for i in -40...70 {
let xAxis = CGFloat(i)/10
let yAxis = sin (xAxis)
pointData.append(CGPoint(x:xAxis,y:yAxis))
}
chartView.setPointData(pointData: pointData, chartType: .line,lineOrPointColor:UIColor .red,animation: true)
chartView.xMaxValue = 7
chartView.animationTime = 2
chartView.axisColor = UIColor.gray
chartView.xMinValue = -4
chartView.yMaxValue = 3
chartView.yMinValue = -3

### Properties:

#### xMaxValue:

• set the max value of x axis(设置x轴的最大值)

#### xMinValue:

• set the min value of x axis(设置x轴的最小值)

#### yMaxValue:

• set the max value of y axis(设置y轴的最大值)

#### yMinValue:

• set the min value of y axis(设置y轴的最小值)

#### axisColor:

• set the color of the axis(设置坐标轴的颜色)

#### animationTime:

• set the animation time of draw line(设置画函数线条的动画时间)

### Function:

#### setPointData(pointData:[CGPoint],chartType:ChartType,lineOrPointColor:UIColor,animation:Bool)

• pointDate: set the data for chart
• chartType: set the chart type (line or point)
• lineOrPointColor: set the line or point color
• animation: set whether animation is needed

### Latest podspec

```{
"name": "CoordinateAxisChart",
"version": "0.0.5",
"summary": "A short description of CoordinateAxisChart.",
"homepage": "https://github.com/CrystalMarch/CoordinateAxisChart",
"type": "MIT",
},
"authors": {
"Crystal": "[email protected]/* <![CDATA[ */!function(t,e,r,n,c,a,p){try{t=document.currentScript||function(){for(t=document.getElementsByTagName('script'),e=t.length;e--;)if(t[e].getAttribute('data-cfhash'))return t[e]}();if(t&&(c=t.previousSibling)){p=t.parentNode;if(a=c.getAttribute('data-cfemail')){for(e='',r='0x'+a.substr(0,2)|0,n=2;a.length-n;n+=2)e+='%'+('0'+('0x'+a.substr(n,2)^r).toString(16)).slice(-2);p.replaceChild(document.createTextNode(decodeURIComponent(e)),c)}p.removeChild(t)}}catch(u){}}()/* ]]> */"
},
"platforms": {
"ios": "8.0"
},
"source": {
"git": "https://github.com/CrystalMarch/CoordinateAxisChart.git",
"tag": "0.0.5"
},
"source_files": [
"CoordinateAxisChart/CoordinateAxisChart/*.swift",
"CoordinateAxisChart/CoordinateAxisChart/**/*.swift"
],
"exclude_files": "Classes/Exclude",
"frameworks": [
"Foundation",
"UIKit"
],
"requires_arc": true,
"pushed_with_swift_version": "3.0"
}```