I've worked large time with AChartEngine and now I know to plot a special bar diagram. Most of the bars are small. But two of them are much bigger than the others. If I use the function "setXAxisMax", the small bars are ridiculous small in the chart.
My question is, is there any way to plot the axis and some of the bars in two parts using ACharEngine? Or is it only possible to plot continuous bars?
Thanks in advance.
I have also had the chance of using a few graphing engines and i haven't
come across any that allows one to draw a single bar as two parts.In any case it will be very misleading when reading the values of the graphs.One solution which i use frequently would be to set a min value for the axis(y-axis) so that the values don't start from zero.that way you reduce the range significantly.
Related
I wonder if it is possible to achieve something like this with MPAndroidChart library?
Basically, I want to have multiple line charts with different Y axis stacked vertically sharing the same X axis (when I move, zoom or highlight a value I want them to be synchronized). If I get it right, there is no explicit support for this behavior.
I tried to manipulate the values (set negative ones with offset) of the second dataset and I was able to achieve the desired charts placement. But I couldn't find a way to draw the values correctly on the Y axis (AxisValueFormatter isn't enough because I need alternate granularity).
Now I'm thinking of having multiple charts glued together and synchronized by callbacks and zoom/move/highlight them programmatically. But I fear it may affect the performance since I need to work with thousands of data points.
Any ideas? I may even take a look at other free libraries if they can do it, but I prefer to stick with MPAndroidChart as I have good experience with it.
I am creating a line chart using MPAndroidChart, all is working great, but I've noticed that at the labels often become bunched up. I know there is a way to prevent this (I've seen other apps that don't have this issue,) but I don't know what setting to enable.
There are a couple of ways you could make the labels fit better.
Decrease the text size of the X axis labels with mChart.getXAxis().setTextSize(float)
Set a label count limit for the X axis using mChart.getXAxis().setLabelCount(int). This should work fine, as you are already not showing one label per data point.
Change the date format of your label.
Some, all or none of these might help you, depending on your requirements. Good luck!
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 have problem with displaying of bars value. I want to display multiply bar chart, but when values are similar, then text is not very good readable :(.
See picture here.
Do you have some ideas for improving this?
Thanks
I would suggest that you either develop some kind of mechanism that disables the drawing of values if they are too close to each other.
Other than that, you could:
disable drawing the values in general
reduce the text size drastically
reduce the number of decimals
use the ValueFormatter interface and disallow drawint 0 values
I have an android app that collects data and I need to graph that data. The dataset could be a few hundred samples, to tens of thousands. The X axis is time. The Y axis can have 1 to 15 different sets of data.
I've looked into some graphing libraries such as achartengine, but they all seem to expect that your graph will have a fairly compact dataset that fits nicely in a screen. With 20k samples, my graph will be much wider than it is tall. Actually I never really want the Y axis taller than the screen, the zoom should zoom only in the X axis.
My ideal interface is basically like a sideways listview that you can just fling left or right to scroll the really wide graph. Zoom will simply compress or expand the time scale.
In any case, my question is what are the best practices when trying to do something like this? I can find graphing tutorials, but nothing that addresses this problem specifically. It would seem very wasteful to try and render the whole graph at once. But I want the slide navigation to be smooth. Will drawing a screen at a time to the canvas be fast enough for a smooth scroll? Or will I have to go to openGL?
Thanks.
I hear users of AChartEngine mentioning that they add tens of thousands of data values in the model and AChartEngine still handles and displays them fine.