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
Related
I need to show chart with dashed line in my application. I am using MpAndroidChart to achieve it. It works, but when data contains too much values, it works incorrectly. For example:
Only 7 values on chart:
Over 500 values:
How to fix it?
The library behaves as expected. The problem is that you are providing too many data points so that the curve overlaps itself (and thus the dashing is displayed as in your image).
Depending on your use case I can suggest the following solutions:
Reduce the line width (probably not sufficient in your case)
Smooth the data points (on this page an overview of possible methods is given)
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.
Below is the chart I am trying to create using MPAndroidChart library:
required_graph
To create this graph, I need some way to tell the linechart to only show two y-values "Average" and "You". I also need a way to draw a vertical grid-line that only goes up to the circle/y-value. I have searched for tutorials, SO articles, issues on MPAndroidChart github as well as the wiki, but I'm still uncertain how to create the graph above. Is there a way to create this graph with MPAndroidChart? Any help is much appreciated.
Try creating multiple data sets and style them differently. The 1st one should contain all the values, including "Average" and "You", enable fill color and disable drawing the circles.
Then, create a new set with a single value (average) and give it a different style. Do the same with the "you" value.
Good luck !
I'm developing an android application in which I want to show a set of aptitude's person and a numeric rating associated to each one of them.
Currently, my approach is a ListView where each row shows a TextView with the name of the aptitude and a RatingBar representing its value. The problem is, I have to show around 6-10 rows which in most cases fills the screen and from my point of view, it's not an elegant solution.
I came out with the idea of representing the info as a key-value set in a polygonal chart. Something like this:
I'm guessing I will need to be working with Canvas, which I have never did before. I would like to ask for a first steps of how would you get into this approach (if there's models to be defined, which android apis to use) or even better, if there's any library to get something like this.
Checkout MPAndroidChart
it has Radar Chart (spider web chart) which is highly customizable.
you get something like this
I'm currently working on my first android application and now use the achartengine library.
My question: Is there a function to read out y-values from a chart by passing an x-value as a parameter?
I have a line chart using a TimeSeries with several custom dates (for example 07/24/12 and 07/29/12). Now I want to pass another date (for example 07/25/12) and get the corresponding y-value - even though it is not stored in the TimeSeries.
I just wanted to ask, if there is a simple way like a single function to achieve this aim, otherwise I'll think about a more complicated solution on my own. In my above example, of course, it sounds quite easy to calculate the demanded y-value, but in practice it is going to be more difficult I guess.
Thank you.
No, there isn't such thing in AChartEngine.