GithubHelp home page GithubHelp logo

xhacker / teachart Goto Github PK

View Code? Open in Web Editor NEW
1.2K 1.2K 135.0 139 KB

Simple and intuitive iOS chart library. Contribution graph, clock chart, and bar chart.

License: MIT License

Objective-C 98.10% Ruby 1.90%

teachart's People

Contributors

ankraft avatar fanzeyi avatar joeblau avatar mathewa6 avatar mythodeia avatar skumancer avatar xhacker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

teachart's Issues

Contribution Graph: Using locale for weekdays

The order of weekdays seems to be hard coded, where the week always starts on Sunday. Would it be possible to change this in order to support locales where the week starts on Monday?
I guess one way to achieve this could be by adding 1 to the index (in case the week starts on Monday) and doing a modulus by 7 afterwards.
It would be great if this could be implemented.

show data of selected days in contribution graph

how can we show data of selected days in contribution graph?
My code is like:

- (NSInteger )valueForDay:(NSUInteger)day
{
    return 4;

}

which show 4 grade data for all the days (1-31) what if i want to show data for only 13th and 14th date? how to do that?

Is it possible to use the contribution chart programmatically?

Hello,

according to the docs Storyboard is supported so I was assuming programmatic approach should work too, but it is not explicitly stated.

If using programmatically it is currently not possible to use an own delegate because loadDefaults() will be invoked first thing in the initWithFrame/-Coder. So setting the delegate after that has no effect.

As a workaround I am currently using plain init and I have exposed loadDefaults in the .h.
It would be great if this is supported right away. Or am I missing something?

Love the charts!
Best,
Masa

swift demo?

any swift demos or sample code? or bridging header file?

[For Test Jam] Tests

Things I’d like if you’re adding tests for this project:

Tooling: XCTest

Notes:

  • In order to write unit tests, we must split the calculation parts out of -drawRect:s (especially in TEAContributionGraph.m) first
  • Maybe write some tests based on image comparison. I don’t know how to do that though.

Accessibility for VoiceOver users

Issue

First, thanks for the great library! I'm opening this issue since it's a bit more code than can comfortably fit in a pull request. Currently all 3 charts : Bar, Contribution and Clock are not visible to blind users or anyone using the VoiceOver utility in iOS (Settings > General > Accessibility > VoiceOver).

Details/Reproduce

When used in an app, such as the Demo project: Bar and Clock charts are ignored (as can be verified using the Xcode Accessibility Inspector in Developer Tools) and Contribution chart outputs unusable information since it defaults to each block acting as a button.

Fix/Proposal

I have fixed this issue by implementing the UIAccessibility methods defined here. Since the branch I modified these on edited the implementation files of all 3 classes and the README, I'm opening this issue to both bring your attention to the feature as well as suggest that I open a pull request that fixes the above.

Note that the accessibility feature in no way affects regular use of TEAChart in any way. These methods simply allow users who rely on VoiceOver to now use the data contained in the chart.

User interaction with contribution graph

It would be awesome to have a callback when a user selects a certain date in the contribution graph! A couple ideas: draw the calendar using subviews, or use a collectionview. both would be a major undertaking, though.

View width is not eqaully splitting

screen shot 2017-12-22 at 4 03 01 pm

This is my code..!

TEABarChart *barChart = [[TEABarChart alloc] initWithFrame:CGRectMake(0.0, 0.0, barView.frame.size.width, barView.frame.size.height)];
barChart.barColors = @[[UIColor grayColor]];
barChart.data = @[@2, @7, @1, @8, @2, @8, @10, @23];
[barView addSubview:barChart];

i have given 8 values but showing 7 bars only

Artefacts when the Bar Chart's total width isn't wholly divisible by the number of bars.

Nice UIView subclass, exactly what I needed for lots of lightweight bar charts.

I've spotted an issue with the drawing when the Bar Chart's width divided by number of bars isn't a whole number.

E.g. a width of 320 and 12 bars produces (colours for illustration purposes :-) ):

ios simulator screen shot 29 jan 2014 10 56 26

It looks to me like you could maybe add some minor padding logic by detecting remainders with fmodf.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.