目录
目录README.md

LineChart

A simple animated LineChart example.

import SwiftUI

struct ExampleView: View {
  @ObservedObject
  var model = LineModel()

  var body: some View {
    Color.white
      .overlay(
        LineShape(model: model)
          .fill(gradient)
      )
      .onTapGesture {
        withAnimation {
          model.add(CGFloat.random(in: 0...100))
        }
      }
  }

  var gradient: LinearGradient {
    LinearGradient(
      gradient: Gradient(colors: [Color.green, Color.green.opacity(0.2)]),
      startPoint: .top,
      endPoint: .bottom
    )
  }
}
关于
32.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号