{"id":26078354,"url":"https://github.com/danielepantaleone/dpcharts","last_synced_at":"2025-04-11T23:51:39.833Z","repository":{"id":175616416,"uuid":"646950208","full_name":"danielepantaleone/DPCharts","owner":"danielepantaleone","description":"A lightweight framework to render charts on iOS written in Swift","archived":false,"fork":false,"pushed_at":"2024-02-07T13:46:13.000Z","size":1435,"stargazers_count":13,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T19:48:50.402Z","etag":null,"topics":["bar-chart","charts","donut-chart","heatmap","line-chart","pie-chart","scatter-chart","stacked-bar-chart","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danielepantaleone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-05-29T18:05:12.000Z","updated_at":"2025-03-10T05:08:07.000Z","dependencies_parsed_at":"2023-10-31T09:28:39.470Z","dependency_job_id":null,"html_url":"https://github.com/danielepantaleone/DPCharts","commit_stats":null,"previous_names":["danielepantaleone/dpcharts"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielepantaleone%2FDPCharts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielepantaleone%2FDPCharts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielepantaleone%2FDPCharts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danielepantaleone%2FDPCharts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danielepantaleone","download_url":"https://codeload.github.com/danielepantaleone/DPCharts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248497874,"owners_count":21113984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bar-chart","charts","donut-chart","heatmap","line-chart","pie-chart","scatter-chart","stacked-bar-chart","swift"],"created_at":"2025-03-09T03:59:01.393Z","updated_at":"2025-04-11T23:51:39.812Z","avatar_url":"https://github.com/danielepantaleone.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg alt=\"logo\" src=\"./Assets/DPChartsLogo.png\"\u003e\n\u003c/p\u003e\n\n[![Swift](https://img.shields.io/endpoint?url=https://swiftpackageindex.com/api/packages/danielepantaleone/DPCharts/badge?type=swift-versions\u0026style=flat-square)](https://swiftpackageindex.com/danielepantaleone/DPCharts)\n[![Platform](https://img.shields.io/endpoint?url=https://swiftpackageindex.com/api/packages/danielepantaleone/DPCharts/badge?type=platforms\u0026style=flat-square)](https://swiftpackageindex.com/danielepantaleone/DPCharts)\n![CocoaPods](https://img.shields.io/cocoapods/v/DPCharts?style=flat-square)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/danielepantaleone/DPCharts?style=flat-square)\n![GitHub](https://img.shields.io/github/license/danielepantaleone/DPCharts?style=flat-square)\n\nDPCharts is a Swift-based lightweight framework designed specifically for rendering charts on iOS. Its main objective is to create a user-friendly chart library that follows the iOS delegation pattern approach. Each chart within the framework is responsible solely for presenting data, rather than managing the data itself. To manage the data, you provide the chart with a datasource object (an object conforming to the chart datasource protocol). Additionally, charts manage gesture interaction, and touch gesture events are delivered to the configured delegate (an object conforming to the chart delegate protocol).\n\n## Table of contents\n\n* [Feature Highlights](#feature-highlights)\n* [Available Charts](#available-charts)\n    * [BarChart](#barchart)\n    * [BarChart (stacked)](#barchart-stacked)\n    * [LineChart](#linechart)\n    * [LineChart (with area)](#linechart-with-area)\n    * [LineChart (with bezier curve)](#linechart-with-bezier-curve)\n    * [LineChart (with bezier curve and area)](#linechart-with-bezier-curve-and-area)\n    * [ScatterChart](#scatterchart)\n    * [PieChart](#piechart)\n    * [PieChart (as Donut)](#piechart-as-donut)\n    * [Heatmap](#heatmap)\n* [Installation](#installation)\n    * [Cocoapods](#cocoapods)\n    * [Swift Package Manager](#swift-package-manager)\n* [Running the demo](#running-the-demo)\n* [Documentation](#documentation)\n* [Contributing](#contributing)\n* [License](#license)\n\n## Feature Highlights\n\nDPCharts provides several features and extensive customization options. Presented below is a concise list showcasing some of its capabilities:\n\n- **5** different chart types\n- **Legend** support using a specific view (see [DPLegendView](./Sources/DPCharts/Views/DPLegendView/DPLegendView.swift))\n- **Storyboard** support by means of **@IBDesignable** and **@IBInspectable**\n- **Animations** support (where applicable)\n- **Touch gesture** interaction\n- **UIKit** based apps support\n- **Highly customizable** (colors, fonts, axis positioning, spacing, insets ...)\n\n- Data control achieved by implementing a **datasource** protocol\n- User interaction by means of implementing a **delegate** protocol\n- APIs that resemble well-known UIKit views like **UITableView** and **UICollectionView**\n\n## Available Charts\n\n### BarChart\n\nA bar chart is a graphical representation of data using rectangular bars to represent different categories or variables. Each bar's length corresponds to the value or frequency of the category it represents.\n\n![BarChart](./Assets/Charts/BarChart.png)\n\n```swift\nlet barChartView = DPBarChartView()\nbarChartView.datasource = self\nbarChartView.barStacked = false\nbarChartView.xAxisTitle = \"Title of X-axis\"\nbarChartView.yAxisInverted = false\nbarChartView.yAxisMarkersWidthRetained = true\nbarChartView.yAxisTitle = \"Title of Y-axis\"\n```\n\n### BarChart (stacked)\n\n\nA stacked bar chart is a type of graphical representation that uses rectangular bars to display multiple categories or variables, stacked on top of one another. Each bar segment represents a specific category or subgroup, and the total height of the stacked bars corresponds to the cumulative value or frequency of the variables being represented.\n\n![StackedBarChart](./Assets/Charts/StackedBarChart.png)\n\n```swift\nlet barChartView = DPBarChartView()\nbarChartView.datasource = self\nbarChartView.barStacked = true\nbarChartView.xAxisTitle = \"Title of X-axis\"\nbarChartView.yAxisInverted = false\nbarChartView.yAxisMarkersWidthRetained = true\nbarChartView.yAxisTitle = \"Title of Y-axis\"\n```\n\n### LineChart\n\nA line chart is a graphical representation of data that uses lines to connect data points, typically showing the relationship or trend between two or more variables over a specific period.\n\n![LineChart](./Assets/Charts/LineChart.png)\n\n```swift\nlet lineChartView = DPLineChartView()\nlineChartView.datasource = self\nlineChartView.bezierCurveEnabled = false\nlineChartView.areaEnabled = false\nlineChartView.xAxisTitle = \"Title of X-axis\"\nlineChartView.yAxisInverted = false\nlineChartView.yAxisMarkersWidthRetained = true\nlineChartView.yAxisTitle = \"Title of Y-axis\"\n```\n\n### LineChart (with area)\n\nA line chart with an area is a type of graphical representation that combines the features of a traditional line chart with the addition of a shaded area beneath the line. The line represents the trend or relationship between variables over time or a continuous scale, while the shaded area beneath the line represents the cumulative values or frequencies.\n\n![LineChartArea](./Assets/Charts/LineChartArea.png)\n\n```swift\nlet lineChartView = DPLineChartView()\nlineChartView.datasource = self\nlineChartView.bezierCurveEnabled = false\nlineChartView.areaEnabled = true\nlineChartView.xAxisTitle = \"Title of X-axis\"\nlineChartView.yAxisInverted = false\nlineChartView.yAxisMarkersWidthRetained = true\nlineChartView.yAxisTitle = \"Title of Y-axis\"\n```\n\n### LineChart (with bezier curve)\n\nA line chart with a Bezier curve is a special graphical representation of a line chart that uses a smooth, curved line to connect data points, showing the trend or relationship between variables over time or a continuous scale. The Bezier curve is a mathematical curve that provides a smooth and visually appealing interpolation between data points.\n\n![LineChartBezierCurve](./Assets/Charts/LineChartBezierCurve.png)\n\n```swift\nlet lineChartView = DPLineChartView()\nlineChartView.datasource = self\nlineChartView.bezierCurveEnabled = true\nlineChartView.areaEnabled = false\nlineChartView.xAxisTitle = \"Title of X-axis\"\nlineChartView.yAxisInverted = false\nlineChartView.yAxisMarkersWidthRetained = true\nlineChartView.yAxisTitle = \"Title of Y-axis\"\n```\n\n### LineChart (with bezier curve and area)\n\nA line chart with a Bezier curve and an area combines the smooth, curved line of a Bezier curve with the added visual representation of the cumulative values or frequencies through a shaded area beneath the curve.\n\n![LineChartBezierCurveArea](./Assets/Charts/LineChartBezierCurveArea.png)\n\n```swift\nlet lineChartView = DPLineChartView()\nlineChartView.datasource = self\nlineChartView.bezierCurveEnabled = true\nlineChartView.areaEnabled = true\nlineChartView.xAxisTitle = \"Title of X-axis\"\nlineChartView.yAxisInverted = false\nlineChartView.yAxisMarkersWidthRetained = true\nlineChartView.yAxisTitle = \"Title of Y-axis\"\n```\n\n### ScatterChart\n\nA scatter chart, also known as a scatter plot, is a graphical representation that displays individual data points as dots on a two-dimensional coordinate system. It is used to show the relationship or correlation between two variables. Each data point on the chart represents a specific value pair for the two variables being analyzed.\n\n![ScatterChart](./Assets/Charts/ScatterChart.png)\n\n```swift\nlet scatterChartView = DPScatterChartView()\nscatterChartView.datasource = self\nscatterChartView.xAxisTitle = \"Title of X-axis\"\nscatterChartView.yAxisInverted = false\nscatterChartView.yAxisMarkersWidthRetained = true\nscatterChartView.yAxisTitle = \"Title of Y-axis\"\n```\n\n### PieChart\n\nA pie chart is a circular graphical representation that visually displays data as slices of a pie. Each slice in the chart represents a different category or variable, and the size of each slice corresponds to the proportion or percentage of the whole it represents.\n\n![PieChart](./Assets/Charts/PieChart.png)\n\n```swift\nlet pieChartView = DPPieChartView()\npieChartView.datasource = self\npieChartView.donutEnabled = false\n```\n\n### PieChart (as Donut)\n\nA donut chart is a circular graphical representation similar to a pie chart, but with a hollow center. It is formed by creating a hole in the middle of the pie chart, resulting in a ring-like structure.\n\n![PieChartDonut](./Assets/Charts/PieChartDonut.png)\n\n```swift\nlet pieChartView = DPPieChartView()\npieChartView.datasource = self\npieChartView.donutEnabled = true\npieChartView.donutTitle = \"Title\"\npieChartView.donutSubtitle = \"Brief description\"\npieChartView.donutVerticalSpacing = 4.0\n```\n\n### Heatmap\n\nA heatmap chart is a graphical representation that uses color-coded cells or rectangles to display data in a matrix or table format. It is particularly useful for visualizing and analyzing data sets that have multiple variables or dimensions.\nIn a heatmap chart, each cell in the matrix represents a specific combination of variables or categories. The color of each cell is determined by the value or magnitude of the data it represents. Typically, a color gradient is used, where lighter or darker shades of a color represent higher or lower values, respectively.\n\n![Heatmap](./Assets/Charts/Heatmap.png)\n\n```swift\nlet heatmapView = DPHeatMapView()\nheatmapView.datasource = self\nheatmapView.xAxisInverted = false\nheatmapView.yAxisInverted = false\n```\n\n### Heatmap (with cell text)\n\nA heatmap chart with text inside cells is a graphical representation that combines the visual elements of a heatmap with the inclusion of textual information within each individual cell. It is often used to display and analyze data that involves both numerical values and corresponding labels or categories.\n\n![Heatmap](./Assets/Charts/HeatmapText.png)\n\n```swift\nlet heatmapView = DPHeatMapView()\nheatmapView.datasource = self\nheatmapView.cellTextEnabled = true\nheatmapView.xAxisInverted = false\nheatmapView.yAxisInverted = false\n```\n\n## Installation\n\n### Cocoapods\n\nAdd the dependency to the `DPCharts` framework in your `Podfile`:\n\n```ruby\npod 'DPCharts', '~\u003e 1.3.0'\n```\n\n### Swift Package Manager\n\nAdd it as a dependency in a Swift Package:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/danielepantaleone/DPCharts.git\", .upToNextMajor(from: \"1.3.0\"))\n]\n```\n\n## Running the demo\n\nDPCharts includes a demo application to showcases all the chart features it offers.\n\n- Make sure you are running a supported version of Xcode.\n- Open the `DPCharts-Demo-iOS/DPCharts-Demo-iOS.xcodeproj` Xcode project.\n- Run the `DPCharts-Demo-iOS` on a simulator.\n\n## Documentation\n\nThis library is currently lacking any form of structured documentation. However, Swift documentation can be accessed directly in Xcode Quick Help. Currently, there is no need for comprehensive documentation because using DPCharts' views simply involves adding the desired chart subview to your ViewController hierarchy and configuring a datasource and delegate (resemble **UITableView** and **UICollectionView** usage). Storyboard in-place configuration is also supported.\n\nIf you need assistance in using DPCharts please [open an issue](https://github.com/danielepantaleone/DPCharts/issues).\n\n## Contributing\n\nIf you like this project you can contribute it by:\n\n- Submit a bug report by opening an [issue](https://github.com/danielepantaleone/DPCharts/issues)\n- Submit code by opening a [pull request](https://github.com/danielepantaleone/DPCharts/pulls)\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2023 Daniele Pantaleone\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielepantaleone%2Fdpcharts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielepantaleone%2Fdpcharts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielepantaleone%2Fdpcharts/lists"}