SNLWeekChartView 1.1.1

SNLWeekChartView 1.1.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Oct 2015

Maintained by Simon Nickel.



  • By
  • Simon Nickel

SNLWeekChartView is a wrapper to easily create a JBChartView representing a week. Just layout your SNLWeekChartView in your storyboard and style it using IB_DESIGNABLE. Set your values in your ViewController and you are done.

Features

  • Configure and Preview view in storyboard.
  • Supports week start on monday or sunday.
  • Weekday and value labels.
  • Custom padding.
  • ...

Example

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

SNLWeekChartView is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "SNLWeekChartView", "~> 1.1.0"

Usage

To use it in your project:

  1. Install with CocoaPods.
  2. Add a UIView in your storyboard and change it's class to SNLWeekChartView.
  3. Connect the view to your ViewController and set its values.
- (void)viewDidLoad
{
    [super viewDidLoad];

    self.weekView.values = @[@(1), @(2), @(0), @(1), @(3), @(1)];
}

Customization

Colors & Fonts

You can set the colors (background, chart, value label, weekday label [past, current, future]) and fonts (value label, weekday label [past, current, future]) in storyboard or by settings their properties in your ViewController.

Layout

You can set the padding between bars with dynamic padding classes (weekView.paddingWidth = ChartWeekPaddingWidthDefault, not supported in storyboard) or a fixed value (weekView.paddingValue). Padding can be applied on the outside of the view (paddingAppliedOnOutside).

Informations

You can ...

  • Disable value and week labels (weekView.showValues, weekView.showWeekdays).
  • Switch to show values as percentages (weekView.percentageMode).
  • Highlight past, current and future weekdays (highlightWeekdays).
  • Set the weekdays to start on Sunday (startsOnMonday).

Changelog

v1.1.1

  • Fix weekday label highlighting on sunday.

v1.1.0

  • Added options to show empty values as "0" or "-", with custom color.
  • Improved example.

v1.0.4

  • Fix weekday label highlighting default font for future days.

v1.0.3

  • Fix weekday label highlighting for week start on monday.

v1.0.2

  • Improve example project.
  • Fix weekday label highlighting for week start on monday.

v1.0.1

  • Add Dokumentation
  • Fix outside padding: also applied on top and bottom to make use of background color.

Author

Simon Nickel, [email protected], @simonnickel

License

SNLWeekChartView is available under the MIT license. See the LICENSE file for more info.