展示图形的轻量级解决方案:MCGraphView
jopen
10年前
用于显示图形的轻量级解决方案。
使用MCGraphView
Add the MCGraphView
class either programmatically or assign the custom class via storyboard. Then set the lineData
property:
self.graphView.lineData = @[ @[ [NSValue valueWithCGPoint:CGPointMake(1, 20)], [NSValue valueWithCGPoint:CGPointMake(2, 40)], [NSValue valueWithCGPoint:CGPointMake(3, 20)], [NSValue valueWithCGPoint:CGPointMake(4, 60)], [NSValue valueWithCGPoint:CGPointMake(5, 40)], [NSValue valueWithCGPoint:CGPointMake(6, 140)], [NSValue valueWithCGPoint:CGPointMake(7, 80)], ], @[ [NSValue valueWithCGPoint:CGPointMake(1, 40)], [NSValue valueWithCGPoint:CGPointMake(2, 20)], [NSValue valueWithCGPoint:CGPointMake(3, 60)], [NSValue valueWithCGPoint:CGPointMake(4, 100)], [NSValue valueWithCGPoint:CGPointMake(5, 60)], [NSValue valueWithCGPoint:CGPointMake(6, 20)], [NSValue valueWithCGPoint:CGPointMake(7, 60)], ] ];