Adding Sin/Cos waves to a view - android

Is there a way to have a View in my XML file which builds graphs, based on different input from the user? All the graphs should be sin/cos waves....I have asked this on here before but the responses I received don't seem to cover Sin/Cos waves, just simple line graphs. I was told about achartengine, and Google Chart Tools.

You can download the AChartEngine demo here and give it a try.
There is this part of the demo that does exactly what you need.

If you already have the function for the data you're trying to display, you can use the Canvas to plot the data points you want:
Canvas Tutorial: http://www.tutorialforandroid.com/2009/06/drawing-with-canvas-in-android.html

Related

How to draw area chart in Android using MPAndroidChart?

I am looking for a way to draw area chart using MPAndroidChart. I am aware , I can use StackedBar Chart but that doesn't quite serve the purpose.
Is there a way to draw Area chart such as shown below using MPAndroidChart and if not what might be the suitable alternate?
sample image souce-wikipedia
you can make chart as you want using MPAndroidChart.
I tested using sample app in google Play Store(try search 'MPAndroidChart').
try multiLineChart and make option Toggle Filled. I think this is what you're looking for.

achartengine - plotting moving and still graphs

Is there any efficient way of doing this? My screenshot from Android device
As for now I am reading accelerometer data
(all graphs are moving to the left edge of screen) and compare them with my black threshold.
When new accelerometer single data arrives, I plot all three values (red,blue,black). This means adding three new points to the correspondent series at the end and removing the first point from series (to enable 'movement').
Is there an option to avoid adding new points to the black graph (threshold) to make it plot in an efficient manner? Or maybe this is quite efficient option, huh?
There are many options to do graphing. If you want static graphing you can use these API's/code samples.
AChartEngine
Simple Line Chart
Draw a Graph
Charts4j
AndroidPlot - one of the best looking ones, does dynamic plots too and is now open sourced.
TeeChart
So many others to choose from but most are static and non of these can handle real time data plots, i.e. ECG wave forms. One example you might want to look at is the Tricorder android example. Problem it is really complex to setup and if you just want the graphs, there is so much code to rip out. It can be done but I even noticed there is a lag the longer you run the program.
So far the only way I have found a real good dynamic graphing, is to do it yourself and use the SurfaceView and then draw usin the path.lineTo() see below for previous SO answer for this solution.
SO example:

What do you call the stat breakdown when creating a new character on Ragnarok Online?

I remember when creating a character in RO, there is this hexagonal object where the different points are either str, agi, dex, etc and when you click any of the points the 3d shape in the middle would adjust itself to reflect the values.
I want to know what it is called so I can research properly how to implement it on Android and in a circular border with 5 points. If you have ant libs that can also implement this it would be greatly appreciated!
Attached is a sample image of the stat distribution
https://lh4.googleusercontent.com/proxy/2EEDcqZyzR9MXMTBikgCLWl62fnURjTjFeemrSbuzn_KjkdUMy_1mThurMBN4iiXXJV5RfzscgAS1xe0hQ3-MVY7fbwp9i8oIukJ_pmGaXvGAw=w360-h270-nc
These are named spider web chart or radar charts.
Here's a library: Github Link

AchartEngine Android Special Pie Chart

I'm using the AchartEngine libraries to make a pie chart app. But I want to display two dimensional data like this
I can get nice standard pie charts but I know how to do the second dimension. Can anyone please help? The guys on the achartengine-google-support group say it's possible but I was redirected here for tech questions.
Many Thanks
If you take a look at the Budget Pie chart demo it shows you how to highlight a section of your pie chart (https://code.google.com/p/achartengine/source/browse/trunk/achartengine/demo/org/achartengine/chartdemo/demo/chart/BudgetPieChart.java). Take a look at "Project 1" below to see how this looks.
However there is no way to change the radius like you want to in your screenshot above. If you want to achieve this the easiest way would be to extend PieChart and copy over the draw method. In the draw method where it renders highlighted sections (if (seriesRenderer.isHighlighted()) ...) use a different radius instead of translating to an offset.

How to draw a dynamic line graph in Android ?

I've got a requirement for my application is to draw a line graph that can be changed on the fly. Eg. A heartbeat graph, a graph that represents the temperature etc..
How can I achieve this in a non-JS way on android?
I would check out these open source Android graph libraries:
http://code.google.com/p/chartdroid/wiki/Screenshots
http://androidplot.com/wiki/Home
http://code.google.com/p/achartengine/
Let us know which one worked for you.

Categories

Resources