Giter Site home page Giter Site logo

iosplot's Introduction

iOSPlot

Draw pie charts and line charts in iOS apps

Todo for line chat

Use gesture/tap to show the value label (or mild statistics) for a data point. Further break out colors for customization of background, x/y labels, and shadows. Allow legend labels to appear on either the right or left side of the chart (or not at all). Use the rendered string width of the legend labels to determine right/left side margin. If a legend string is significantly long (200% percentage of default margin width?), truncate or abbreviate it to X characters.

Todo for pie chat

Use gesture/tap to show the value label Display legend

Minimum Requirements

  • ARC - this project uses ARC. If you are not using ARC in your project, add '-fobjc-arc' as a compiler flag for StyledPageControl.h and StyledPageControl.m
  • XCode 4.4 and newer (auto-synthesis required)

Contact

twitter.com/honcheng
honcheng.com

iosplot's People

Contributors

3rdcycle avatar elitalon avatar grgcombs avatar honcheng avatar lbehnke avatar lxcid 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  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

iosplot's Issues

Accommodating missing data in line chart

I really like your new charting library. Very lightweight, visually appealing.

I have a request relating to chart lines that permit "missing" data. For example, if your chart shows yearly sales figures for your sales associates, and one of those associates left the company at the beginning of 2008, but returned in 2009, you wouldn't want his figures to appear as 0.00 sales for 2008. Rather he should have a broken line between 2007 and 2009.

In terms of the data points array, a missing data point could be represented by NSNull or something...

Major issue with Graphing

Hi There,

I ran into an issue with the line plot and brought my app to its knees performance wise. I finally determined where the issue was. Its on line 73 of LineGraphView.m You make a call to
UIGraphicsPushContext(ctx); but then never call UIGraphicsPopContext();
I'm not 100% sure if you need either though.

Thanks,
Niels

Set chart width

Hi, i have set the the my chart just like this:
_lineChartView = [[PCLineChartView alloc] initWithFrame:CGRectMake(100,400,700,400)];

but my line is truncate to the right, even i set the width to > 700 still the line can't fit to the right,

can you help?thanks

Crash in LineChart

Hi,

compile went OK after installing JSONKit from github.

JSONKit.h and JSONKit.m where missing...
(I don't know if that's the correct way?)

The Pie charts and the Half Pie chart work as expected.

Line chart crashes the app.
When starting line chart, it logs:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString objectFromJSONString]: unrecognized selector sent to instance

Kind Regards,
Rene

Build fails with duplicate symbol error

ld: duplicate symbol _jk_collectionClassLoadTimeInitialization in Xcode/DerivedData/PlotCreator-ccpudyikljtxvkfwhdgepyofgolj/Build/Intermediates/PlotCreator.build/Debug-iphonesimulator/PlotCreator.build/Objects-normal/i386/JSONKit-E0F2220995BD635C.o and Xcode/DerivedData/PlotCreator-ccpudyikljtxvkfwhdgepyofgolj/Build/Intermediates/PlotCreator.build/Debug-iphonesimulator/PlotCreator.build/Objects-normal/i386/JSONKit-E0F2220995BD635C.o for architecture i386
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

Need to initialise it with data

Thanks for this, it looks really nice. One problem I ran into is, I added the widget in viewDidLoad and then tried to set its data later, and it didn't display anything. Turns out data has to be set at the time of initialisation or it won't show

ios 8 issue

Not properly working in iphone6/6plus devices

In some special case: it doesnt look good

Hi!

I've changed sample data and iOSPlot didn't show well.
I'm using your framework for my app. Could you fix?

Sample Data:
I tested with demo project from GitHub

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>data</key>
        <array>
            <dict>
                <key>title</key>
                <string>AAA</string>
                <key>value</key>
                <integer>12</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>BBB</string>
                <key>value</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>CCC</string>
                <key>value</key>
                <integer>10</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>DDD</string>
                <key>value</key>
                <integer>30</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>EEE</string>
                <key>value</key>
                <integer>40</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>EEE</string>
                <key>value</key>
                <integer>40</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>EEE</string>
                <key>value</key>
                <integer>40</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>EEE11111</string>
                <key>value</key>
                <integer>40</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>EEE9999999999</string>
                <key>value</key>
                <integer>40</integer>
            </dict>
            <dict>
                <key>title</key>
                <string>EEE88888</string>
                <key>value</key>
                <integer>40</integer>
            </dict>
        </array>
    </dict>
</plist>

Screen shot from simulator (I just test on iOSPlot version 1.0.1 and current version)
ios simulator screen shot jul 24 2013 1 25 57 pm

Legent titles are not displayed

The Legend titles are not displayed when the last data value is null.

    {
        "data": [
            8,
            9,
            2,
            null,
            null,
            null,
    null
        ],
        "title": "Gas"
    } 

ios simulator screen shot oct 24 2013 4 25 37 pm

PieChart cause crash when I touch screen

I test PCPieChart in my project.(iOS 6, Xcode 4.6, not ARC) I place a pie chart in storyboard. It launches successfully. But when I touch the iphone screen, app crashes.
2013-08-12 10 27 35

Real time

Could I use iOS plot for realtime (30 redraws per second)?

JSONKit not included?

github doesn't support gitmodules well, I suggest embedding JSONKit directly, or adding a note to the readme saying which exact version you're using.

(if you hit the download link on github main page, it either fails or doesn't even try to download JSONKit)

Does not compile clean

There are more than a dozen warnings and errors reported after compiling. It does run but all completed projects should compile without warnings or errors in my opinion.

Memory leak in PCPieChart.m

Hi,
the static analyzer complains about this release

- (void)dealloc
{
    [self.titleFont release];  // THIS RELEASE
    [self.percentageFont release];
    [self.components release];
    [super dealloc];
}

By design (Apple documentation):

You do not create UIFont objects using the alloc and init methods. Instead, you use class methods of UIFont to look up and retrieve the desired font object. These methods check for an existing font object with the specified characteristics and return it if it exists. Otherwise, they create a new font object based on the desired font characteristics.

With this caching mechanism in place you think you don't need to retain the font in the first place?

minValue and maxValue issues

I have point from 20 to 24...
so i setted minValue = 19 and maxValue = 25
if i try to plot them they won't show...if i comment these lines everything works good.

How can i solve? How use autoscaleYAxis ??

Thanks.

ARC

The project does not support Arc, any chance I can fork the code to make sure it works for ARC?

Why use NSUinteger in PCLineChartView.m line 105

Hi, I have a problem:

Why use NSUinteger in PCLineChartView.m line 105 as follow:
NSUInteger key = [[NSString stringWithFormat:formatString, y_axis] integerValue];

By this, I countn't set a mapping for a nagtive number, or how should I do this?

Autoresizing PieChart

As most of the data I add to a PCPieChart is dynamic, I don't know how high the PCPieChart view should be. It often happens that percentage labels gets cut off in the bottom of the view.

[pieChart setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin|UIViewAutoresizingFlexibleTopMargin];

makes no difference. How would I autoresize it to fit the labels?

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.