Giter VIP home page Giter VIP logo

echart's Introduction

#EChart A highly extendable, easy to use chart with event handling, animation supported.

How To Use

Step 1

Download project here

And Drag /EChart/ folder into your project

Step 2

Import the head file:

#import "EColumnChart.h"

Make your ViewController adopts the EColumnChart's protocal:

@interface YourViewController : UIViewController <EColumnChartDelegate, EColumnChartDataSource>

Declare a EColumnChart instance:

@property (strong, nonatomic) EColumnChart *eColumnChart;

Step 3

Give your EColumnChart a nice frame:

_eColumnChart = [[EColumnChart alloc] initWithFrame:CGRectMake(40, 100, 250, 200)];

Set EColumnChart's delegate and dataSource to your ViewController:

[_eColumnChart setDelegate:self];
[_eColumnChart setDataSource:self];

Add EColumnChart to wherever you want:

[self.view addSubview:_eColumnChart];

Provide data & Get events

After setting up your EColumnChart, you may need to provide the data for the EColumnChart and you will be able to get events from EColumnChart as well.

If you were a expert with UITableView, you will be quite familier with the way EColumnChart works. Because they work in a same way.

DataSource

You need to implement every method in the EColumnChartDataSource

/** How many Columns are there in total.*/
- (NSInteger) numberOfColumnsInEColumnChart:(EColumnChart *) eColumnChart;

/** How many Columns should be presented on the screen each time*/
- (NSInteger) numberOfColumnsPresentedEveryTime:(EColumnChart *) eColumnChart;

/** The hightest vaule among the whole chart*/
- (EColumnDataModel *)     highestValueEColumnChart:(EColumnChart *) eColumnChart;

/** Value for each column*/
- (EColumnDataModel *)     eColumnChart:(EColumnChart *) eColumnChart
                    valueForIndex:(NSInteger)index;

EColumnChartDelegate

The implementation of the Delegate is according to your needs

/** When finger single taped the column*/
- (void)        eColumnChart:(EColumnChart *) eColumnChart
         didSelectColumn:(EColumn *) eColumn;

/** When finger enter specific column, this is dif from tap*/
- (void)        eColumnChart:(EColumnChart *) eColumnChart
    fingerDidEnterColumn:(EColumn *) eColumn;

/** When finger leaves certain column, will tell you which column you are leaving*/
- (void)        eColumnChart:(EColumnChart *) eColumnChart
    fingerDidLeaveColumn:(EColumn *) eColumn;

/** When finger leaves wherever in the chart, will trigger both if finger is leaving from a column */
- (void) fingerDidLeaveEColumnChart:(EColumnChart *)eColumnChart;

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.