Coder Social home page Coder Social logo

cschartsview's Introduction

CSChartsView

Introducing CSChartsView -A light weight line graph drawing framework

Features

  • iPhone and iPad support

##Requirements

  • Requires iOS 6.0 or later
  • Requires Automatic Reference Counting (ARC)

Installation & Usage

If you're using CocoaPods, simply add pod ‘CSChartsView’ to your Podfile. If you wish to use the static library check out the installation documentation

Consulting

If you need additional support or help integrating and/or customizing the controller for your project, feel free to get in touch ([email protected]).

PreViewing

Alt text Alt text Alt text Alt text Alt text

cschartsview's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

cschartsview's Issues

Landscape / Deprecations

Hey,

Looks good, however, I'd like to show the chart in landscape.
Also there are some depreciations.

Would have loved to have used this...

I think I'd also like to economize the background, not looked to see if that is possible.

Also again not looked, but I'd have a date filter, so I would need this to redraw after selection of a new date.

Jules.

Support initWithCoder:

Now only code-based initialization supported. I wish I could just put a custom view in IB to make it work.

EXC_BAD_ACCES

When execute this code:

     self.chartsView = [[CSChartsView alloc] initWithFrame:CGRectMake(0, 64, 320, 320)];
[self.view addSubview:self.chartsView];
    self.chartsView.yAxisMax = 100;
    self.chartsView.yAxisMin = 0;
    self.chartsView.yAxisSignAmount = 15;
self.chartsView.yAxisSignFormat = @"%0.0f";
self.chartsView.detailRectUnitString = @"times/h";
//self.chartsView.detailRectSize = CGSizeMake(180, 125);


   self.chartsView.xAxisSignArray = [NSArray arrayWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",@"11",@"12",@"13",@"14",@"15",@"16",@"17",@"18",@"19",@"20",@"21",@"22",@"23",@"24",@"25",@"26",@"27", nil];



CSChartsPoint *point0 = CSChartsPointMake(1, 10);
point0.pointStyle = CSChartsPointStyleSolidWhite;
point0.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point1 = CSChartsPointMake(2, 2);
point1.pointStyle = CSChartsPointStyleSolidWhite;
point1.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point2 = CSChartsPointMake(3, 0);
point2.pointStyle = CSChartsPointStyleSolidWhite;
point2.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point3 = CSChartsPointMake(4, -2);
point3.pointStyle = CSChartsPointStyleSolidWhite;
point3.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point4 = CSChartsPointMake(5, 6);
point4.pointStyle = CSChartsPointStyleSolidWhite;
point4.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point5 = CSChartsPointMake(6, 6);
point5.pointStyle = CSChartsPointStyleSolidWhite;
point5.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point6 = CSChartsPointMake(7, 6);
point6.pointStyle = CSChartsPointStyleSolidWhite;
point6.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point7 = CSChartsPointMake(8, 10);
point7.pointStyle = CSChartsPointStyleSolidWhite;
point7.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point8 = CSChartsPointMake(9, 6);
point8.pointStyle = CSChartsPointStyleSolidWhite;
point8.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point9 = CSChartsPointMake(10, 6);
point9.pointStyle = CSChartsPointStyleSolidWhite;
point9.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point10 = CSChartsPointMake(11, 0);
point10.pointStyle = CSChartsPointStyleSolidWhite;
point10.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point11 = CSChartsPointMake(12, 2);
point11.pointStyle = CSChartsPointStyleSolidWhite;
point11.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point12 = CSChartsPointMake(13, 6);
point12.pointStyle = CSChartsPointStyleSolidWhite;
point12.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point13 = CSChartsPointMake(14, 0);
point13.pointStyle = CSChartsPointStyleSolidWhite;
point13.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point14 = CSChartsPointMake(15, -2);
point14.pointStyle = CSChartsPointStyleSolidWhite;
point14.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point15 = CSChartsPointMake(16, 6);
point15.pointStyle = CSChartsPointStyleSolidWhite;
point15.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point16 = CSChartsPointMake(17, 0);
point16.pointStyle = CSChartsPointStyleSolidWhite;
point16.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point17 = CSChartsPointMake(18, 6);
point17.pointStyle = CSChartsPointStyleSolidWhite;
point17.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point18 = CSChartsPointMake(19, 2);
point18.pointStyle = CSChartsPointStyleSolidWhite;
point18.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point19 = CSChartsPointMake(20, 6);
point19.pointStyle = CSChartsPointStyleSolidWhite;
point19.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point20 = CSChartsPointMake(21, 6);
point20.pointStyle = CSChartsPointStyleSolidWhite;
point20.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point21 = CSChartsPointMake(22, 2);
point21.pointStyle = CSChartsPointStyleSolidWhite;
point21.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point22 = CSChartsPointMake(23, 2);
point22.pointStyle = CSChartsPointStyleSolidWhite;
point22.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point23 = CSChartsPointMake(24, 0);
point23.pointStyle = CSChartsPointStyleSolidWhite;
point23.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point24 = CSChartsPointMake(25, 0);
point24.pointStyle = CSChartsPointStyleSolidWhite;
point24.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point25 = CSChartsPointMake(26, 6);
point25.pointStyle = CSChartsPointStyleSolidWhite;
point25.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];

CSChartsPoint *point26 = CSChartsPointMake(27, -2);
point26.pointStyle = CSChartsPointStyleSolidWhite;
point26.color = [UIColor colorWithRed:228 / 255.0 green:81 / 255.0 blue:26 / 255.0 alpha:1];


self.chartsView.mainLinePointArray = [NSArray arrayWithObjects:point0,point1,point2,point3,point4,point5,point6,point7,point8,point9,point10,point11,point12,point13,point14,point15,point16,point17,point18,point19,point20,point21,point22,point23,point24,point25,point26, nil];



self.chartsView.detailRectTextFormat = @"%0.f ";
self.chartsView.isRegionSeparated = NO;
self.chartsView.colorRegionArray = [NSArray arrayWithObjects:CSChartsColorRegionMake([UIColor colorWithRed:211 / 255.0 green:234 / 255.0 blue:210 / 255.0 alpha:1], 40),CSChartsColorRegionMake([UIColor colorWithRed:244 / 255.0 green:250 / 255.0 blue:246 / 255.0 alpha:1], 40),nil];

This produces an EXC_BAD_ACCESS in class CSChartsMainLineLayer in this line

-(void)drawPoints:(CGContextRef)ctx{
->NSArray *pointArray = self.charts.mainLine.pointArray;

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.