## SPChart
SPChart is a powerful charting library for iOS apps, allowing developers to create visually appealing and interactive charts with ease. This library offers a wide range of customizable charts, including bar, line, pie, scatter, and more. With SPChart, developers can effortlessly present their data in a visually engaging manner.
### Features
* Support for various chart types:
* Bar charts
* Line charts
* Pie charts
* Scatter charts
* and more
* Easy data visualization:
* SPChart simplifies the process of transforming raw data into visually stunning charts.
* Interactive charts:
* Users can interact with the charts by zooming, panning, and tapping on data points.
* Customizable appearance:
* Developers can easily customize the appearance of the charts, including colors, fonts, labels, and more.
* Integration with SwiftUI:
* SPChart seamlessly integrates with SwiftUI, enabling developers to build charts in SwiftUI-based apps.
* Comprehensive documentation:
* The library provides detailed documentation and examples to assist developers in utilizing SPChart efficiently.
### Installation
To install SPChart in your project, you can use any of the following methods:
#### Cocoapods
1. Add the following line to your `Podfile`:
“`ruby
pod ‘SPChart’
“`
2. Run the command `pod install` in the terminal.
#### Manual Installation
1. Download the SPChart library from the official GitHub repository.
2. Drag and drop the library files into your Xcode project.
3. Make sure to check the “Copy items if needed” option.
### Usage
Using SPChart in your iOS app is straightforward. Follow the steps below:
#### Importing SPChart
Import the SPChart module in your Swift file:
“`swift
import SPChart
“`
#### Creating a Chart
To create a chart, initialize an instance of `SPChartView` and add it to your view hierarchy.
“`swift
let chartView = SPChartView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
view.addSubview(chartView)
“`
#### Supplying Data
SPChart supports various data formats, such as arrays and dictionaries. For example, to create a bar chart, provide an array of data points:
“`swift
let dataPoints = [10, 15, 20, 25, 30]
chartView.setDataPoints(dataPoints)
“`
#### Customizing Appearance
SPChart offers extensive customization options. You can modify various chart properties such as colors, fonts, labels, and more.
“`swift
chartView.color = .blue
chartView.dataLabelFont = UIFont.systemFont(ofSize: 12)
// Customize other properties as desired
“`
#### Interacting with Charts
SPChart provides built-in gestures for interacting with charts. Users can zoom, pan, and tap on data points for a more immersive experience.
“`swift
chartView.enableZooming = true
chartView.enablePanning = true
// Handle tap events using delegate methods
“`
### Examples
To help you get started with SPChart, we’ve provided example projects and code snippets on the official GitHub repository. These examples cover a wide range of chart types and demonstrate various customization options.
### Resources
Explore the following resources to learn more about SPChart:
#### Documentation
The official SPChart documentation provides detailed information on the library’s usage, available APIs, and customization options. Visit our [documentation page](https://spchart.com/docs) to get started.
#### GitHub Repository
Visit the [official SPChart GitHub repository](https://github.com/SPChart/SPChart) to access the source code, examples, and contribute to the development.
#### Support
For any questions or assistance, reach out to our support team at [support@spchart.com](mailto:support@spchart.com). We are here to help you integrate SPChart smoothly into your app.