Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adventam10/amvenndiagramview
AMVennDiagramView is a view can display the diagram like Venn diagram.
https://github.com/adventam10/amvenndiagramview
chart diagram graph ios swift swift4 venn-diagram
Last synced: about 2 months ago
JSON representation
AMVennDiagramView is a view can display the diagram like Venn diagram.
- Host: GitHub
- URL: https://github.com/adventam10/amvenndiagramview
- Owner: adventam10
- License: mit
- Created: 2018-02-17T09:41:16.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-14T11:22:32.000Z (about 5 years ago)
- Last Synced: 2024-10-19T19:35:32.187Z (2 months ago)
- Topics: chart, diagram, graph, ios, swift, swift4, venn-diagram
- Language: Swift
- Homepage: https://qiita.com/am10/items/858041f70be4d8de5090
- Size: 75.2 KB
- Stars: 38
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AMVennDiagramView
![Pod Platform](https://img.shields.io/cocoapods/p/AMVennDiagramView.svg?style=flat)
![Pod License](https://img.shields.io/cocoapods/l/AMVennDiagramView.svg?style=flat)
[![Pod Version](https://img.shields.io/cocoapods/v/AMVennDiagramView.svg?style=flat)](http://cocoapods.org/pods/AMVennDiagramView)
[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)`AMVennDiagramView` is a view can display the diagram like Venn diagram. It displays two circles whose area ratio is almost an accurate.
## Demo
## Usage
Create vennDiagramView.
```swift
let vennDiagramView = AMVennDiagramView(frame: view.bounds)
view.addSubview(vennDiagramView)
vennDiagramView.setupVennDiagram(value1: 1000, value2: 500, commonValue: 200)
vennDiagramView.dataSource = self
```Conform to the protocol in the class implementation.
```swift
// MARK:- Required
func vennDiagramView(_ vennDiagramView: AMVennDiagramView, fillColorForSection section: Int) -> UIColor
func vennDiagramView(_ vennDiagramView: AMVennDiagramView, strokeColorForSection section: Int) -> UIColor
// MARK:- Optional
func vennDiagramView(_ vennDiagramView: AMVennDiagramView, titleForSection section: Int, value: CGFloat) -> String // default is empty
func titleForCommonArea(in vennDiagramView: AMVennDiagramView, value: CGFloat) -> String // default is empty
func vennDiagramView(_ vennDiagramView: AMVennDiagramView, textColorForSection section: Int) -> UIColor // default is black
func textColorForCommonArea(in vennDiagramView: AMVennDiagramView) -> UIColor // default is black
func vennDiagramView(_ vennDiagramView: AMVennDiagramView, textFontForSection section: Int) -> UIFont // default is System 17.0
func textFontForCommonArea(in vennDiagramView: AMVennDiagramView) -> UIFont // default is System 17.0
````section` of `value1` is `0`. `section` of `value2` is `1`.
## Installation
### CocoaPods
Add this to your Podfile.
```ogdl
pod 'AMVennDiagramView'
```### Carthage
Add this to your Cartfile.
```ogdl
github "adventam10/AMVennDiagramView"
```## License
MIT