I am using achartengine and i need some way to draw text and annotations on the graph. Additionally when I slide the graph horizontally the annotations move as well. Is there any way to do it or do I have to implement my own drawing method?
I have edited achartengine source code to add annotations capabilities. You can see it here.
Related
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.
Hi i wanted to create area graph chart and pie chart in android without using any 3rd party library, from the scratch, can you please give me some reference how to draw it from the scratch?
see method descriptions in this class for drawing and filling primitives (rectabgles, polylines, arcs, etc) https://developer.android.com/reference/android/graphics/Canvas.html
I am using a chart library called MPAndroidChart and I am very pleased with it. However, I want to draw a thick vertical line (as a background, not as data) serving as an indicator in the the middle of the line graph. How can I do this?
Best regards.
You can use the LimitLine class to acheive this.
Basically, that class allows you to draw a customizeable line to a specified position on the y-axis in the chart and add a description to it.
After creating the line, you need to assign it to an XAxis or YAxis.
For more details, have a look at the documentation. You can find limitlines it on the bottom of the page.
Also, this example class shows how to use them: https://github.com/PhilJay/MPAndroidChart/blob/master/MPChartExample/src/com/xxmassdeveloper/mpchartexample/LineChartActivity1.java
UPDATE: Now LimitLines can be assigned to any axis!
You can draw verctical lines on your graphic using Highlight class. See https://stackoverflow.com/a/42852833/4361772
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 use AFreeChart chart(XYPlot) lib for my project. However i want to get xy-dataset values when i touch curve points, do you have any idea is there any onClicklistener for graph points?
I'm not familiar with aFreeChart but based on this answer the solution would seem to be to add a ChartTouchListener to your chart, this will allow you to access the ChartEntity under the touch point if there is one.