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
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 have data points offline in a file where i need to plot it in graph
I have tried AChartEngine, AndroidPlot but I needed in this sequence in the image below, How to achieveit, please suggest.
Used Chart Engine, created custom x & Y axis made 4 fragments and added the graphs to display. It is done.
I am trying to make a simple smooth line chart which show the X axis as date-time on bottom and Y axis as normal left side. I just started using MPAndroidChart API and its example app in Git. In the example Line chart I am not able to find option to change X axis labels to show on bottom instead of top as show currently.
Just like:
Also is there a way to handle date-time data for X axis values ?
Also I tried my hand on Androidplot API but to make the line smooth there I need to make changes in library code which is not compiling at all in my Eclipse and giving errors. Also in Androidplot I did not find an option to show popup with data once I click on line chart.
So if anyone know how to make a smooth line chart using Androidplot API without modifying its library code and how to bring small popup with data in Androidplot API please reply.
// XAxis settings
graph.getXAxis().setPosition(XAxis.XAxisPosition.BOTTOM);
graph.getXAxis().setLabelsToSkip(0);
// and
// make the line smooth
graph.getLineData().getDataSets().get(0).lineDataSet.setDrawCubic(true);
Refer this:
http://wptrafficanalyzer.in/blog/android-drawing-line-chart-using-achartengine/
for smooth curve lines please refer this:
How to make line with rounded (smooth) corners with AndroidPlot
Hope this may help you.
AChartEngine is a charting library for Android applications. Using AChartEngine library, we can plot various charts like line chart, area chart, pie chart, time chart, bubble chart etc.
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.
This question is specific to the opensource GraphView library. (https://github.com/jjoe64/GraphView)
Have someone used it to add marker in it?
I want to create a realtime ECG graph with it. And need to create a vertical line when user press a button. I like the GraphView library as its simple and support realtime continuous stream of data.
this is not possible out of the box.
You should have a look into the source code of Graphview (https://github.com/jjoe64/GraphView). The code is really simple.
Take a look to the method onDraw() of GraphView.java. There you should be able to draw lines...
I have solved the issue, here is the trick.
Add an other series,
add two points (x, min_y_value) and (x, max_y_value) ... where x is the horizontal position where you want to add marker.
obviously it include some handling as line is continuous graph.. when I was using continuous graph.. I was running that marker line on top of my graph i.e (x, max_y_value) and when ever i need to draw marker, I pull it down like (x, min_y_value) then pull back up in straight line with same x value (x, max_y_value).. obviously there will be a visible line on top of graph that you can hide by some overlay.