In my android application i have developed Graph functionality using aChartEngine android.Every thing fine .I need to draw a circle on the two time series colliding point in graph.Below i show the screen hot of the application.Please help me
One thing is sure here: AChartEngine won't provide you APIs for detecting the intersection point between the 2 lines.
If you can compute that yourself then you could add a third series with one single point that would render the intersection point. You will have to set a point style for this series such as you can see it better.
Related
I have to draw a graph on android with:-
X-axis's labels starting from the right-hand side of the graph and
ending to the left. (i.e; label with low value positioned on the
right while labels with higher values positioned left)
Y-axis positioned on the right side of the graph.
I have tried graphview (library) in android but could not find a way to plot x-axis from right to left manner. (As explained above) However, managed to plot Y-axis. (As managed above).
Tried MPChart (library as well) unfortunately that also did not work.
Any suggestion or idea will be a great help.
I am attaching the image as well for you to understand what exactly I want my graph to look like.SEE IMAGE HERE
If the input data is not dynamic you can always graph it it in reverse order by reversing the Array/List and plotting it normally. I've had to use some hack around code to rotate my Graph to make the x axis on the left and y axis on the bottom using MPAndroidChart. But it seems like you already tried attempted that solution, so I honestly would just reverse graph it.
Something like : Collections.reverse(Arrays.asList(a));
"For all my graphing needs I used: MPAndroidChart
This guy made a awesome library and so easy to implement it has really good doceumation to get started found here: MPAndroidChartDocumentation"
I want to draw a graph on my android app. I did some reading and found out that using a canvas I can draw anything I want on the android app.
I am looking for a canvas which runs with a predefined time (say 10 seconds) as X-axis and draw the waveform which defines the Y-axis. I would want to get values out the graph drawn too.
Any library that I can employ? Is using a canvas the only option or do I have other options?
I don't think you need a library for this. Your requirement seems simple and could be accomplished by writing a custom view. You can utilize the onDraw(canvas) to draw the graph. You can use a Handler to post the x/y coordinate (run it every 10 seconds), or by any other means. A custom view is an excellent option to keep things modularized and you could get the graph at any time via getDrawingCache().
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:
I'm trying to create a graph on android using the android graphview library.
1)I need to plot points on the graph (Currently, the options are LineGraph and BarGraph) however i wish to only plot the points without drawing a line.
2) Change the positioning of the X axis and it's labels(such that it shows on the top and not the bottom).
I'm looking through the API but cannot find a way to do these things. Would really appreciate if anyone could help out!
it is not possible do to exactly that what you want with android GraphView but should not be hard to modify the library to do so, because the features already exists.
LineGraphView can draw data points.
take a look at the methods
setDrawDataPoints
setDataPointsRadius
BarGraphView can draw the labels on top of the bar
take a look at the method
setDrawValuesOnTop
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.