RP Radar Chart
This is a simple library for plotting Radar Charts (or Spider Web Charts) in iOS.
Examples (Using random values):
This library is under development, actually is part of an App I'm developing at work, so don't expect it to be finished. I know the code is messy, sorry about that (I'll try to beautify it in the future). Anyway, even if isn't finished you already can:
- Plot one or more set of floats.
- Set a different color for each set.
- Customize how is the chart displayed:
- Line width
- Dots radius
- Show or not values.
- Show or not guide lines.
- Show or not guide numbers.
- Fill or not the drawed area.
- Addjust values positions if needed.
- Add a Legend for each data set.
- Animate a transitions from one data set to another.
Just add RPRadarChart.h and RPRadarChart.m to your project. You can plot something with this few lines:
You can use simple data source protocol to show values on chart such as:
// get number of spokes in radar chart
// get number of datas
// get max value for this radar chart
// get title for each spoke
- (NSString)radarChart:(RPRadarChart)chart titleForSpoke:(NSInteger)atIndex;
// get data value for a specefic data item for a spoke
- (float)radarChart:(RPRadarChart*)chart valueForData:(NSInteger)dataIndex forSpoke:(NSInteger)spokeIndex;
// get color legend for a specefic data
- (UIColor)radarChart:(RPRadarChart)chart colorForData:(NSInteger)atIndex;
RPRadarChart is licensed under MIT License Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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 OR COPYRIGHT HOLDERS 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.