MPAndroidChart draw multiple charts lined vertically with shared X axis - android

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.

Related

MPAndroidChart - animations between real-time data points

I am currently using MPAndroidChart to display real-time data. I have been able to add points to a line chart and update a radar chart with the data. However, I am having issues with implementing smooth animations when updating the charts.
So, for example, instead of just redrawing the line chart to include a new point of data, I would like the line to gradually extend to a new data point, sliding to the right if an old data point is being replaced (when outside of the visible axis range). And in the radar chart, if a point of data changes from, say, 20 to 60, I would like the point on the chart to smoothly move from the 20 to 60 instead of the chart being completely redrawn.
At the moment, I have found the animateX, animateY, and animateXY methods in the library. However, these only seem to be for initially creating the chart. I need there to be animations while data is continually added to an existing chart. Is it possible with this library? What kinds of tweaks would I need to make?

How to implement multiple highlight line sliders in line chart

I want to implement single and multiple highlight line sliders in line chart. I am able to get only single highlight line slider with MPAndroidChart (https://github.com/PhilJay/MPAndroidChart) library. But I also need two highlight line sliders to allow the user to select range of values(min and max values) on the chart. Please refer the below image for more information:
Can we achieve the above requirement with any library or we need to draw a custom view?
Any help or guidance will be well appreciated.
In terms of shinobicharts, while the Crosshair could be easily customised to act like one of sliders, in order to have the two sliders you'd probably want to make use of the Annotations feature.
You can create Annotations with custom Views and add them at any X, Y point (in data terms). You can also convert between data values and pixel values via the Axes. It is therefore possible to make the Annotation follow the user's finger as they drag across the screen.
The trickiest part would be placing the circle on the LineSeries at the right Y-value. As I mentioned above you can convert pixel values (e.g. from a user gesture) to data values so you could easily get the X value but the API would leave quite a bit of work up to you in order to get the correct Y value.
This kind of feature is something that is requested quite often and is certainly something we are looking at providing in the future but for now, while possible, it isn't available out-of-the-box.
Disclaimer: I work for shinobicontrols

Achartengine bardiagrams with too high values

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.

Standard practices for graphing large datasets in android

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.

What's the best way to draw a pie chart in Android with selectable slices?

I've looked into achartengine and a couple other options, but none of them seem to support any way to implement drill down into the data.
I had a similar problem, but with histograms. I ended up creating a custom view that:
takes a maximum value as the top of the graph, to make a proportion with values to graph (you have 360 constant degrees)
an array of values
a parameter for column width
then draws the histogram (it won't be too hard drawing a pie chart) and overriding onTouchEvent() to determine which column was clicked.
As we're talking of a pie chart you'll have to do some more maths to find which slice was clicked.

Categories

Resources