Giter VIP home page Giter VIP logo

xlstockchart's Introduction

XLStockChart

K线图(烛线图,分时图,MA、VOL、MACD、KDJ、RSI) 捏合手势 加载更多等等

iOS 9.0+ Swift 4.0+ MIT

XLStockChart是一个用于区块链币价或股票行情显示的库。

Example

	// 日期显示类型 日K以内是MM/DD HH:mm  日K以外是YY/MM/DD
    dateType = .min
    
    // K线类型 烛线图/分时图
    lineType = .candleLineType
    
    // 主图显示 默认MA
    var mainString = KLINEMA
    
    // 副图显示 默认VOL
    var secondString = KLINEVOL
    
    var dataArray = [XLKLineModel]()
    
    switch sender.currentTitle {
    case KLINETIMEMinLine:
        // 分时
        dataArray = getModelArrayFromFile("minLineData")
        lineType = .minLineType
    case KLINETIME5Min:
        // 5分钟
        dataArray = getModelArrayFromFile("5MinData")
    case KLINETIME15Min:
        // 15分钟
        dataArray = getModelArrayFromFile("15MinData")
    case KLINETIME1Hour:
        // 1小时
        dataArray = getModelArrayFromFile("1HourData")
    case KLINETIME1Day:
        // 日K
        dataArray = getModelArrayFromFile("1dayData")
        dateType = .day
    case KLINETIME1Week:
        // 周K
        dataArray = getModelArrayFromFile("1WeekData")
        dateType = .day
    default:
        break
    }
    
    if dataArray.count > 0 {
        // 模拟网络请求
        DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
            self.kLineView.configureView(data: dataArray, isNew: true, mainDrawString: mainString, secondDrawString: secondString, dateType: dateType, lineType: lineType)
        }
    }

Features

  1. 支持分时图烛线图MAVOLMACDKDJRSI最高&最低等数据展示。
  2. 支持横屏查看。
  3. 手势捏合、长按展示详情、加载更多数据等。
  4. K线图利用 UIScrollView 达到流畅的滑动查看效果, 减少重绘渲染次数。
  5. 使用 CAShapeLayer 绘图,内存占用更小,效率更高。

Requirements

  • iOS 9.0+
  • Swift 4

xlstockchart's People

Contributors

sum123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.