iOS: draw editable Graphs in iPad App, using html5 - ios

In my App I need to draw graph data with different datamodels that frequently change and can not be generalized. This graph data must be editable with a slider or a segmented control.
The idea is to load all necessary data to draw the graph from the server. Is html5 the right solution? Can the iPad-UI-Controlls used to manipulate the graph?
Where do I start and how much work is it?
Currently I'm using Core Plot to draw the graph - but I need to model my graph data on the server.

Option 1: If you are developing for Android as well or you are better at javascript, then you can use HTML5.0. Have a look at http://www.sencha.com/products/touch/charts/
Option 2: If you want to develop it natively for iPad(which I feel is a better option), then please look at google library for graph http://code.google.com/p/core-plot/ and Is there a good charting library for iPhone?

I extended the work of this gentleman:
http://buildmobile.com/creating-a-graph-with-quartz-2d/#fbid=EKAB22zV7It
And I'm quite pleased with the results. It took me about a week to get my graph able to draw a stock chart with scrolling, pinching zooming, 3 different symbol indicators, a secondary plot line, tap-able data points with a little custom popover showing details, and a few annotations. Not bad considering the overall complexity, and largely thanks to the detailed walkthrough.
He also talks about why he didn't use Core Plot.
Good luck,
Damien

Related

What kind of chart is suitable for work flow? and it should be free

I have a requirement in my product to create an widget to have workflow kind of process.
If you see attached image , I am looking for similar kind of chart.
As we have already fusion charts with us, is it possible to have similar stuff?
Since you already have FusionCharts, I would recommend using the Drag Node Chart. The chart is exactly of the type you need and the dragging functionality can be easily turned off!
http://www.fusioncharts.com/charts/drag-node-charts/
In fact, one of the examples look very close to the image in your question and as far as I can tell, the chart can be customised to look almost same -
http://www.fusioncharts.com/charts/drag-node-charts/
Only downside that I can think of is that you will have to manually calculate the position of your workflow nodes (the connectors will connect automatically.) However, the positions can be easily computed by writing simple function on the beforeDataUpdate event fired by the chart.
PS: Using the annotations feature, you can dynamically position texts labels, images, and other such items arounds your process diagram.

Drawing a custom bar chart graph in iOS(PowerPlot vs Core plot)

I have been looking all around the net for open source graph plot framework for iOS, but I am struggling with it as of now. I have worked on an app and used PowerPlot Graph Plot framework http://powerplot.nua-schroers.de/examples/webtraffic.html
I am trying to draw a bar graph chart showing two years at once without stacking each, like in the image below: As you can see there is a problem of resizeing and the scaling isnt uniform. I would like to make the chart look bigger and the y axis be more formatted.
Any suggestions because I always hear about core plot also by which you can achieve such(see below), but all i hear about coreplot is flexibility and customization issues.
You can easily produce a bar plot like that with Core Plot. Give it a try and ask specific questions here on StackOverflow if you get stuck.

Complex Number App - graphing with core-plot, power-plot or else?

I'm coding iOS app that will explain complex numbers to the user. Complex numbers can be displayed in Cartesian coordinates and that's what I want to do; print one or more vectors on the screen.
I am looking for the easiest way to print 3 vectors into a coordinate system that will adjust itself to the vector-size (if x-coord is > y-coord adjust both axis to x-coord and vice versa).
I tried using Core Plot, which I think is way too multifunctional for my purpose.
Right now I am working with PowerPlot and my coordinate system looks okay already, but I still encounter some problems (x- and y-axis are set to the x and y values which results in a 45 degree angled line, no matter the user input).
The functionality of the examples in CorePlot and PowerPlot don't seem to meet my needs.
My last two approaches were using HTML and a web view, and doing it all myself with Quartz (not the simple way...)
Do you have any advice how to do this the simple way, as it is a simple problem, I guess?
If you're not wanting to do much actual graphing and plotting, then using Core Plot or similar sounds like overkill to me. The extra bloat of adding coreplot to your project, not to mention the time taken for you to understand how to use it, might not be worth it for some simple graphics.
Quartz is well equipped for the job of showing a few vectors on the screen, assuming you're not interested in fancy 3D graphics. There are plenty of tutorials and examples of using Core Graphics (AKA Quartz) to draw lines etc. If you're going the Quartz route, perhaps get some simple line drawing going in Quartz, then ask more questions if you need help with the maths aspect of it.
The typical technique used when rendering with Quartz is to override drawRect in a subclass of UIView and place calls to Core Graphics drawing functions in there.
A decent question and example of Quartz line drawing is here:
How do I draw a line on the iPhone?
If you aren't adverse to using Google Chart Image you can load reasonably complex data sets in a simple manner by calling the appropriate URL and then putting the image in a UIImageView. It takes very little code: here is a blog post explanation with sample code.
The limitations are
length of the data set is restricted by the max URL length you can request from Google (2048 characters, with encoding is large), though I've plotted with 120 data points in 4 series.
a net connection is required (at least to get the initial chart)
and perhaps the biggest problem, API is deprecated and will be discontinued in 2015 at some point. You would then have to switch to the UIWebView/Javascript Google Chart API implementation...
Sample image:

Is there a graphical tool for Mac to assist in positioning CCNode objects on a Layer?

If my designer gives me a 960x640px image of what the screen should look like, as well as all of the individual elements as images or text, is there a way to lay out the images and text on the iPhone/iPad screen without doing it manually through code? The way I'm doing it now is a series of trial and error, trying to guess the position of each element.
By the way, the types of layouts I'm trying to do are simple static layouts for stuff like Menus and High Scores lists, etc.
You should try one of the editing tools: LevelHelper, CocoShop and CocosBuilder. The problem will be the output format, make sure that not only the editing part works to your specification but that you can actually use just the snippet of code you need to plug it into your code.
Do you have an image-editing software like Photoshop or GIMP? How about opening the 960x640px image with any such software, then hovering your mouse over the center of each element for its coordinates, and then finally pumping these values into your code?
In my opinion, this is at least better and way faster than trial and error:)
If you want to measure position of graphic elements. You can try a commercial called xscope. The trail version can be downloaded form their official website. It is the best tool I ever seen to measure distance, color(like, it can copy color measured directly to [UIColor ...] format), etc. If you want something freeware, I would like to recommend markman, which is a Chinese software, it's built on adobe air. All elements/button are graphic, so you don't need to read chinese to use it..
You can try to use some open source editor and write your exporter. For example I am using blender as a level editor for the game I am working on. It has a nice python API that can be used to export all the information you need.

Animated 2d Map Desktop Widget

I need to animate some vector icons smoothly moving about a 2d map. I have time-lat/lng pairs forming tracks. Down the road I would really like to be able to convey various GIS data like topography and roads on the map along with my smoothly animated icons.
Any suggestions on what to use? I find things like Quantum GIS but it seems geared to generating static maps. I've tried messing around with KML but I cannot find any way to make things move smoothly: marker icons clearly bounce along the waypoints even when I space them very closely.
EDIT: clarified I'm interested in a desktop widget
Animation options are limited in GIS as far as I am aware.
ESRI's ArcObjects could be used to create animations - see this chapter in the online help:
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_animation
and these examples (however none have vectors moving around):
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Sample_animation_videos
ESRI software is expensive to purchase, and users would also need the software if you wanted to provide more than an exported video.
You are probably best working with WPF (is this widget for Windows?), Silverlight, or Flash. ESRI have a Silverlight example here:
http://www.codeproject.com/KB/showcase/GIS_Silverlight.aspx
There is also the following collection of WPF classes for the OpenSource SharpMap:
http://wpfsharpmapcontrols.codeplex.com/
However it seems very much in beta at this stage.
Alternatively it may be easier to use GIS software solely to provide a background image, and do all the animation elsewhere.
I would say, try this animation code for Google Earth; however, try emailing the osgeo or qgis userlists and they'll guide you

Resources