How to put marker in Android GraphView - android

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.

Related

Generate "out of view" markers indicators on a map with React Native

For a project, I have to indicate, with colored arrows, in which direction are the markers that aren't shown in the visible region.
When the user scrolls, or zoom on the map, the arrows move accordingly to where the not visible markers are compared to the current center of the visible region.
Here is a picture that demonstrate what is needed :
I am using react-native-mapview and added regular views over the map to show the indicators.
I've started working on this by comparing the coordinates and calculating the point of intersection between lines (border lines and line made by the 2 coordinates) at each frame. It works fine on iOS but is pretty laggy on Android, especially chan there are a lot of markers involved.
What would be the best and optimized way to do this ?
Maybe you could try using Animated.View instead regular view. It may render more fluently?
pass tracksViewChanges={false} to Markers https://github.com/react-native-community/react-native-maps/blob/master/docs/marker.md

how to plot a graph from right hand side in android ,

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"

2 graphs in same line followed by same sequence in Android

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.

Android GraphView plot only points on graph and change X axis position

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

Colliding point of graph in android by using achartEngine in android

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.

Categories

Resources