Draw gantt chart using UIcollectionviewcontroller? - ios

I have research in forum satackovzrflow and I have found(Using a UICollectionViewController and my own UICollectionViewLayout subclass, I've put together a view that shows a Gannt style time chart. Using that framework to do the bands has been really easy of Travis Griggs) So How can I draw gantt chart Using UIcollectionviewController? Give me any idea to I can start draw it?
http://i.stack.imgur.com/7dg6G.png

Two years ago I have same task. I have folders, and tasks. I done all staff with simple view and autoresizing mask. I go through all tasks, calculate frames and create view hierarchy with this frames. To draw arrows between tasks, I create overlay that draws arrows.
If you really want use UICollectionView, I recommend to you read about custom layout.

Why to reinvent the wheel, you can check one of the library that draw charts on iOS and use it
Check the following Libraries
IQ Widgets
ios-charts
JBChartView
PNChart
The first library IQ Widgets has a Gantt chart

Related

Best approach for user-placeable custom UIViews?

I'm consider the following usage scenario:
The user adds a new shape to a page
He or she places the shape freely on the current view (e.g. using a pan gesture)
Also, the user can resize the shape (e.g. using a pinch gesture on it)
The shape snaps to already existing shapes on the drawing
Implementation details: A page is a custom UIView. The user can add as many shapes as he or she likes. Shapes are instances of different custom UIViews which needs to adapt their content to the new size (see step 3). Overlapping shapes are not possible. And the user must be able to select shapes for operations like "remove".
Question:
I could simply instantiate the shape UIViews and add them as subview to the page UIView. But then I would need to implement all the details like tracking touches to move UIViews to new positions, running the collision detection, handle resize and so on.
Are there controls/classes/... in UIKit, CoreGraphics or the like available which would make my life easier?
I found UIDynamicBehaviors in UIKit. Would this is be way to go or would you suggest a different approach?
Thanks a lot in advance!
Cheers,
Chris

Core Plot library to draw graph in auto layout Xcode 6.1 for any device orientation, legends in iOS

I want to draw graph in iOS native app (Making app using auto layout and Xcode 6.1)..after googling I found core plot lib for drawing graph.
I am struggling with this library to do make pie,bar,donut and line chart as I want.
I used the examples which are in 'examples' folder of this library.
How do I make graph to adjust when app is rotating and takes auto
layout constraints?
For bar/line chart-I don't get idea to make graph compact or make
scroll when there is large data to show on x or y axis?
For any chart- How do I show legends(title or explanation for
graph)?
How do I show values on bar/pie/line itself(Value on each
pie slice / every bar/ every line point)?
Can I set X and Y axis start and end point?
Please help if anybody have an idea? Thanks in advance.
The Plot Gallery example app demonstrates all of these things. You'll need to use the latest code from GitHub (release 1.5.1 doesn't have some of the newer features like auto layout; 1.6 will be out soon, but isn't quite ready yet).
The iOS version of the Plot Gallery uses a storyboard and auto layout to control the UI.
Set allowsUserInteraction to YES on the plot space to enable pinch zoom and scrolling behavior. You can disable pinch gestures and keep the scrolling behavior with the allowPinchScaling property on the hosting view.
Many of the Plot Gallery demos have legends. Look for CPTLegend in the code. Ask a more specific question if you need more help with this.
These are known as "data labels" in Core Plot. Many of the Plot Gallery demos have them. You can set a formatter and text style on the plot to turn them on, or use a plot delegate to have more control over each label.
Set the xRange and/or yRange of the plot space associated with the axes to control the coordinate space of the plot area.

The best way to create animation diagram

I'm trying to create something like this:
I looked many resources for that, but I still don't have idea how can I do it. Using CoreAnimation, Quartz2d or UIBezierPath I can draw a circle, but how can I draw a nice diagram with touch gesture's aid, using that? Maybe I wrong searched? If any tutorial, or sample code for this issue?
Best and easy library I used to draw pie chart with animation; MIM Chart Library for iOS
https://github.com/ReetuRaj/MIMChart-Library
Open source.
OK, CoreAnimation is not what you're looking for with this.
Anyway...
If you want to make a nice Pie Chart then you should take a look at CorePlot.
It has a lot of graphing functions and pie charts are in there too.
You can still animate with this you just need to update the percentages based on touch. Don't try to animate the sections of the circle. Change the percentages and update the circle.
Looks like you are trying to do some charts & plotting. If that is so, there is something called as
Core Plot
ILGraphics
OVGraphView
Some controls as well
Hope that helps.

Drawing on UIButtons

I'm currently writing an app that has a calendar as one of it's screens.
For the calendar I need to place coloured circles under the numbers to represent activities on those days.
I was leaning towards the UIButton's for each day in the calendar so that I could assign the same functionality to all the buttons {including customised drawing routines to handle the coloured circles on each day).
Is it possible to draw coloured circles in on the fly or should I use pre-made images up to a certain number of events (coloured circles)?
Secondly, if I can draw these on the fly, can someone point out the documentation for the classes involved for me to do this?
What I think you are looking for is (UIBezierPath *)bezierPathWithOvalInRect:(CGRect)rect.
The documentation for the class can be found at UIBezierPath Class Reference

draw pie chart using iOS quartz 2D

I am looking for a tutorial where I can draw pie chart programmatically using Core Graphics or Quartz 2D in iOS. I want to understand how can we draw the PIE Chart which is gradient and having multi-color filled slices in it.
Note: Not looking for Coreplot framework.
Please share me some links regarding the same.
I have used "XYPieChart" library in my so many apps and it's very easy to modify.
Available on github.
Link is given below:
https://github.com/xyfeng/XYPieChart
Still needs any help then let me know.
You can also use this library, as this is also completely customisable and too easy to use.
Just use one line of code, this method along with the pie chart view used & the array with values to be rendered in the pie chart view:
- (void)renderInLayer:(RJPieChart *)layerHostingView dataArray:(NSMutableArray*)dataArray
Hope this helps.
Thanks

Resources