All Projects → i-schuetz → Piecharts

i-schuetz / Piecharts

Licence: apache-2.0
Easy to use and highly customizable pie charts library for iOS

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Piecharts

React D3 Components
D3 Components for React
Stars: ✭ 1,599 (+235.92%)
Mutual labels:  graph, chart, pie-chart
Highcharts Chart
Polymer Element wrapper for highcharts library. Seamlessly create various types of charts from one element.
Stars: ✭ 97 (-79.62%)
Mutual labels:  graph, chart, pie-chart
PieCharts
Easy to use and highly customizable pie charts library for iOS
Stars: ✭ 501 (+5.25%)
Mutual labels:  pie-chart, chart
StockView
股票相关控件(分时图、五日分时图、自选股迷你分时图、资金趋势图、盈亏额/盈亏率)- (曲线图、折线图)
Stars: ✭ 87 (-81.72%)
Mutual labels:  pie-chart, chart
Aachartkit
📈📊🚀🚀🚀An elegant modern declarative data visualization chart framework for iOS, iPadOS and macOS. Extremely powerful, supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types. 极其精美而又强大的跨平台数据可视化图表框架,支持柱状图、条形图、折…
Stars: ✭ 4,358 (+815.55%)
Mutual labels:  chart, pie-chart
Charts
Simple, responsive, modern SVG Charts with zero dependencies
Stars: ✭ 14,112 (+2864.71%)
Mutual labels:  graph, chart
Clchart
A fast, simple and cross-platform(html5 react-native weex wechat-applet) stock chart library created using canvas.
Stars: ✭ 250 (-47.48%)
Mutual labels:  graph, chart
Anychart
AnyChart is a lightweight and robust JavaScript charting solution with great API and documentation. The chart types and unique features are numerous, the library works easily with any development stack.
Stars: ✭ 288 (-39.5%)
Mutual labels:  chart, pie-chart
Jira Dependency Graph
Graph visualizer for JIRA tickets' dependencies
Stars: ✭ 194 (-59.24%)
Mutual labels:  graph, chart
Tplink Energy Monitor
An energy monitoring dashboard for TP-Link smart plugs
Stars: ✭ 316 (-33.61%)
Mutual labels:  graph, chart
Flutter Candlesticks
Elegant OHLC Candlestick and Trade Volume charts for @Flutter
Stars: ✭ 318 (-33.19%)
Mutual labels:  graph, chart
Aachartcore Kotlin
📈📊⛰⛰⛰An elegant modern declarative data visualization chart framework for Android . Extremely powerful, supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types.极其精美而又强大的 Android 数据可视化图表框架,支持柱状图、条形图、折线图、曲线图、折线填充图、曲线填充图、气泡图、扇形图、环形图、散点图、雷达图、混合图等各种类型的多达几十种的信息图图表,完全满足工作所需.
Stars: ✭ 332 (-30.25%)
Mutual labels:  chart, pie-chart
Meter
Laravel package to find performance bottlenecks in your laravel application.
Stars: ✭ 204 (-57.14%)
Mutual labels:  graph, chart
Squid
A Ruby library to plot charts in PDF files
Stars: ✭ 205 (-56.93%)
Mutual labels:  graph, chart
Chart.js
Simple HTML5 Charts using the <canvas> tag
Stars: ✭ 55,646 (+11590.34%)
Mutual labels:  graph, chart
Swiftcharts
Easy to use and highly customizable charts library for iOS
Stars: ✭ 2,336 (+390.76%)
Mutual labels:  graph, chart
Fl chart
A powerful Flutter chart library, currently supporting Line Chart, Bar Chart, Pie Chart, Scatter Chart and Radar Chart.
Stars: ✭ 3,882 (+715.55%)
Mutual labels:  graph, chart
Vue D3 Network
Vue component to graph networks using d3-force
Stars: ✭ 415 (-12.82%)
Mutual labels:  graph, chart
Graphic
A Flutter data visualization library based on Grammar of Graphics.
Stars: ✭ 173 (-63.66%)
Mutual labels:  graph, chart
V Chart Plugin
Easily bind a chart to the data stored in your Vue.js components.
Stars: ✭ 188 (-60.5%)
Mutual labels:  graph, chart

PieCharts

Version Carthage compatible License

Easy to use and highly customizable pie charts library for iOS

Swift 4.2, iOS 8+

Video

ScreenShotScreenShot

Features:

  • Customizable slices
  • Add overlays using simple UIViews
  • Interactive
  • Animated
  • Dynamic slice insertion
  • Reusable components via extensible layer system
  • Configurable in interface builder
  • Legends. This is in a separate project to keep things focused and reusable.

Installation

CocoaPods

Add to your Podfile:

use_frameworks!
pod 'PieCharts'

Carthage

Add to your Cartfile:

github "i-schuetz/PieCharts"

Usage

Basic chart:

@IBOutlet weak var chartView: PieChart!

chartView.models = [
    PieSliceModel(value: 2.1, color: UIColor.yellow),
    PieSliceModel(value: 3, color: UIColor.blue),
    PieSliceModel(value: 1, color: UIColor.green)
]

Configurable in interface builder, with live update of the view:

ScreenShot

Overlays:

Overlays are implemented using layers. There are several built in layers and you also can implement your own ones.

To add text e.g. text labels inside the slices + text with lines outside, simply:

chartView.layers = [PiePlainTextLayer(), PieLineTextLayer()]

Each layer has its own customization options. For example, here we customize the plain labels layer:

let textLayerSettings = PiePlainTextLayerSettings()
textLayerSettings.viewRadius = 55
textLayerSettings.hideOnOverflow = true
textLayerSettings.label.font = UIFont.systemFont(ofSize: 8)

let formatter = NumberFormatter()
formatter.maximumFractionDigits = 1
textLayerSettings.label.textGenerator = {slice in
    return formatter.string(from: slice.data.percentage * 100 as NSNumber).map{"\($0)%"} ?? ""
}

let textLayer = PiePlainTextLayer()
textLayer.animator = AlphaPieViewLayerAnimator()
textLayer.settings = textLayerSettings

This is the custom views layer, which makes possible to create custom views:

let viewLayer = PieCustomViewsLayer()

let settings = PieCustomViewsLayerSettings()
settings.viewRadius = 135
settings.hideOnOverflow = false
viewLayer.settings = settings

viewLayer.viewGenerator = {slice, center in
    let myView = UIView()
    // add images, animations, etc.
    return myView
}

Interactivity, events:

Conform to PieChartDelegate to react to interaction and other events:

func onGenerateSlice(slice: PieSlice)
func onStartAnimation(slice: PieSlice)
func onEndAnimation(slice: PieSlice)
func onSelected(slice: PieSlice, selected: Bool)

Dynamic slice insertion:

chartView.insertSlice(index: 1, model: PieSliceModel(value: 5, color: UIColor.blue))

Contributing

  1. Fork
  2. Commit changes to a branch in your fork
  3. Push your code and make a pull request

Outlook

The layer system can be abstracted a step further in order to make the slices themselves be in a layer. This way we can combine multiple slice-layers to create more complex types of pie charts.

Credits

The food images used in the demo are from freepik.com, and flaticon.com/authors/madebyoliver

Created By:

Ivan Schütz

License

SwiftCharts is Copyright (c) 2017 Ivan Schütz and released as open source under the attached Apache 2.0 license.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].