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])
    

      

  • 相关阅读:
    poj 1149 最大流
    poj 3281 最大流建图
    lightoj 1300 边双联通分量+交叉染色求奇圈
    lightoj 1291 无向图边双联通+缩点统计叶节点
    lightoj 1063 求割点
    lightoj 1026 无向图 求桥
    lightoj 1407 2-sat
    lightoj 1251 (Two_Sat)
    hdu 4681 最长公共子序列+枚举
    OD汇编需要标签
  • 原文地址:https://www.cnblogs.com/studyNT/p/5092471.html
Copyright © 2011-2022 走看看