GithubHelp home page GithubHelp logo

ttgaugeview's Introduction

TTGaugeView

A light weight gauge view written in SwiftUI.

Installation

Xcode 11 and iOS 13 is required.

Swift Package Manager

Manually

Drag TTGaugeView.swift into your project.

Usage

Import

Import the TTGaugeView in the file you would like to use it:

import TTGaugeView

Instantiate view

let angle: Double = 260.0
let sections: [TTGaugeViewSection] = [TTGaugeViewSection(color: .green, size: 0.1),
                                      TTGaugeViewSection(color: .yellow, size: 0.1),
                                      TTGaugeViewSection(color: .orange, size: 0.1),
                                      TTGaugeViewSection(color: .red, size: 0.1),
                                      TTGaugeViewSection(color: .purple, size: 0.2),
                                      TTGaugeViewSection(color: .blue, size: 0.4)]

let valueDescription = "\(Int(value * 100)) %"
let gaugeDescription = "My SwiftUI Gauge"

TTGaugeView(angle: angle, sections: sections, value: value, valueDescription: valueDescription, gaugeDescription: gaugeDescription)

Contributing to this project

If you have feature requests or bug reports, feel free to help out by sending pull requests or by creating new issues. Please take a moment to review the guidelines written by Nicolas Gallagher:

License

TTGaugeView is distributed under the terms and conditions of the MIT license.

Credits

TTGaugeView is brought to you by Tobias Tiemerding. If you're using TTGaugeView in your project, attribution would be very appreciated.

ttgaugeview's People

Contributors

honkmaster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ttgaugeview's Issues

Gauge size not fixed

The gauge's size is not fixed for all values. E.g. it is much smaller at 0.33 than at 0.66, creating a lot of wasted whitespace between the gauge und the text below.

image
image

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.