zoukankan      html  css  js  c++  java
  • 画椭圆型

     

     

                   let testRad = circleRadius * 40
    
    //                let clip : UIBezierPath = UIBezierPath(arcCenter: pt, radius:
    
    //                    CGFloat(testRad), startAngle: 0, endAngle: 180, clockwise: true)
    
    //                
    
    //                clip.addLineToPoint(pt)
    
    //                clip.closePath()
    
    //                clip.addClip()
    
                    let width = testRad * 2
    
                    let height  = testRad
    
                    let originRect = CGRectMake(pt.x - width/2 , pt.y-height/2 , testRad*2, testRad)
    
                    var arc :UIBezierPath = UIBezierPath(ovalInRect:originRect)
    
                    
    
                    UIColor.redColor().setStroke()
    
                    arc.stroke()
    

      

    let testRad = circleRadius * 20
       
       
      let width = testRad * 2
       
      let height  = testRad
       
      let originRect = CGRectMake(pt.x - width/2 , pt.y-height/2 , testRad*2, testRad)
       
      let arc :UIBezierPath = UIBezierPath(ovalInRect:originRect)
      
      let dashes: [CGFloat] = [2, 2]
      arc.setLineDash(dashes, count: 2, phase: 0)
       
      UIColor.redColor().setStroke()
       
      arc.stroke()
    

      

      

    ios-chart写标签

                        let valOffset = Int(dataSet.circleRadius * 1.75 + height/2)
                                            ChartUtils.drawText(context: context, text:displayLabel, point: CGPoint(x: pt.x, y: pt.y - CGFloat(valOffset) - valueFont.lineHeight), align: .Center, attributes: [NSFontAttributeName: valueFont, NSForegroundColorAttributeName: valueTextColor])
    

      

  • 相关阅读:
    Jemter---基础概念
    Jmeter---线程操作
    性能接口面试题
    Linux---网络命令
    测试所用链接地址
    Linux---压缩解压命令
    Linux----用户管理命令
    性能面试题
    Linux---帮助命令
    Linux--文件搜索命令
  • 原文地址:https://www.cnblogs.com/studyNT/p/5092471.html
Copyright © 2011-2022 走看看