1. 画线(实线与虚线)
UIBezierPath * xPath = [UIBezierPath bezierPath];
[xPath moveToPoint:CGPointMake(YLabelWidth + width * i, height)];//设置初始点的位置
[xPath addLineToPoint:CGPointMake(YLabelWidth + width * i, 0)];
CAShapeLayer * xLayer = [CAShapeLayer layer];
xLayer.strokeColor = _lineDashColor.CGColor;
xLayer.fillColor = [UIColor clearColor].CGColor;
xLayer.lineDashPattern = @[@3,@2];//三个像素的实线,两个像素的空格构成的虚线
xLayer.lineWidth = 1;
xLayer.path = xPath.CGPath;
[self.layer addSublayer:xLayer];