Skip to content
No description, website, or topics provided.
Objective-C Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Example
Pod
.gitignore
.travis.yml
LICENSE
README.md
SNLWeekChartView.podspec

README.md

SNLWeekChartView

[![CI Status](http://img.shields.io/travis/Simon Nickel/SNLWeekChartView.svg?style=flat)](https://travis-ci.org/Simon Nickel/SNLWeekChartView) Version License Platform

NOTE:

This project is quite old and will not get any real maintenance updates in the future. I would not recommend integrating it in your project. If you already use it, everythings seems to be working fine still, but might break in the future.

Features

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.

  • 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.2.0

  • Adjusted threshold for small size type.
  • NOTE: This project is quite old and will not get any real maintenance updates in the future.

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, simon@googlemail.com, @simonnickel

License

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

You can’t perform that action at this time.