Thanks for your great library!
We just found one major drawback. We like to draw a time series chart where the values are not equidistant. The x values where points are drawn must be at any position not just distributed equally by index. For example, the x axis represents the date and time (as in this blood pressure chart http://www.andreas-schreiber.net/activities/quantified-self/blood-pressure/).
This applies to line chart and scatter chart.
You are absolutely right, that is kind of a drawback. I work on providing a solution for this issue as fast as possible.
Nevertheless, the charts displayed in your link are already possible (quite likely with some additional but manageable effort).
As a description for the x-axis, you can provide an array of Strings representing each day of the year, meaning 365 entries.
The index on which an actual value will be displayed on can then depend on the day.
Example: Blood pressure 139 measured on January 10th.
--> x-axis index 9
Blood pressure 139 measured on February 2nd.
--> x-axis index 32
It is not necessary that each possible index on the x-axis (ranged from 0 to 365) is bound to a value.
I hope this helps a little bit, regards
Philipp
Hi, Philipp,
we did the workaround that you described. But this does not work for large number of x-values. It just takes too much time.
For example, we need to plot values for about 10 years and we have more than one value per day (sometime >20 values per day).
So, it still would be great if you could support for time series.
best regards
Andreas
+1
+1, looking forward to seeing this feature, the sooner the better : )
+1, I am looking for the same feature as well
+1. Very useful feature
Just looking for the same feature. Great work, anyway!
Thanks for the great library. It would be great if you add this feature asap
+1. I'd love this feature!
Thanks for cool library!
Maybe anyone already make this feature possible?
@PhilJay Are you working on this feature ? I've got some ideas how to make it real.
+1, I am looking for the same feature as well
Hi Guys,
@nekdenis - Could you please discuss the ideas here, I would be glad to contribute using your ideas :)
Thanks,
+1 same here
+1
+1
On Feb 28, 2015 9:22 PM, "Jaroslav Medek" [email protected] wrote:
+1
—
Reply to this email directly or view it on GitHub
https://github.com/PhilJay/MPAndroidChart/issues/12#issuecomment-76531366
.
+1
I am looking for an android equivalent to to vis.js graph2d http://visjs.org/graph2d_examples.html
+1
https://github.com/nekdenis/MPAndroidChart/tree/decart
I've implemented this feature. But here are one bad thing: I'm not using existing data model.
If someone need example usage of this graph I could add it.
+1
+1
+1
+1
+1
+1
+1 man come on it is awesome!!!
Indeed this would make this library the best! Otherwise it already excels
+1
+1
On Tue, Apr 21, 2015 at 3:23 PM, Mathieu De Brito [email protected]
wrote:
+1
—
Reply to this email directly or view it on GitHub
https://github.com/PhilJay/MPAndroidChart/issues/12#issuecomment-94724753
.
Rajat Deshpande
Mechanical Engineering
IIT BOMBAY
+1
+1
I was really impressed with the capabilities of MPAndroidChart but since it's not possible to enter data as (x,y) pairs I can't use it. My application has real-time time-series data with irregular/unpredictable time coordinates for each measurement.
@SoftwareRancher You should be able to do this. You can use e.g. a unix-timestamp type of datasystem.
Only drawback is that you are limited in resolution depending on how large you want your vector to become.
It looked to me (from the API) that the "x values" were basically labels
and would not affect the position of the data on the graph. I need a
set of data points such as
(0, 1), (45,1), (50, 2), (55, 1), (100, 1)
to appear like:
On 04/27/2015 02:52 PM, enffichris wrote:
@SoftwareRancher https://github.com/SoftwareRancher You should be
able to do this. You can use e.g. a unix-timestamp type of datasystem.—
Reply to this email directly or view it on GitHub
https://github.com/PhilJay/MPAndroidChart/issues/12#issuecomment-96816398.
Jim
+1
+1
+1
+1
any news?
+1
:+1: @PhilJay @danielgindi Thanks for the great library! Yet this feature would make it perfect. So I (and I think many others too) would really appreciate it if this feature would come any time soon...
Please keep us posted. Thanks a lot!
Considering the amount of people who would love this feature. Would it make sense to crowdfund it? How much would be required - if that's an option at all for you @PhilJay
+1
@nekdenis
Can you add an example usage of your graph. I didn't find it anywhere.
+1
+1
+1
The library is great. I am using it on my final degree project and I would love to use this feature.
Currently I found a way to use it with not equidistant values even with large values (I tested up to 30000 and there is no problem as the strings are created dynamically) but when you zoom in, the lines on the edges sometimes get invisible https://github.com/PhilJay/MPAndroidChart/issues/801.
In case someone is interested this is the class I use to replace the strings array:
The other methods that needs to be implemented from List
public class MaxList implements List<String> {
private int max;
public MaxList(){
max = 0;
}
@Override
public void clear() {
max = 0;
}
@Override
public String get(int i) {
if (i<1000){
return String.valueOf(i) + "m";
}else{
return String.valueOf(i/1000)+","+String.valueOf(i%1000)+"km";
}
}
@Override
public int size() {
return max+1;
}
public void addMax(int new_max){
if (new_max > max){
max = new_max;
}
}
@Override
public boolean isEmpty() {
return false;
}
}
Remember to set the max value of your data.
Hope it helps someone and thanks for the great library!
+1, this is a much needed feature. Would be happy to contribute.
+1
+1
this is unfortunately a blocking issue for using this great library for our project.
We would definitively donate a good amount if we could use this library.
+1 Huge missing use case. Has anyone bolted on this functionality in a nice way?
I basically hacked up a solution by creating intervals/indices for 1 second, so viewing a graph over a day is 60 * 60 * 24 intervals where the data points are x-intervals away from my start time.
+1
+1
+1
+1
+1
+1
+1 for this feature
That's exactly what I was looking for.
+1 for this feature which will have multiple applications to display various scientific data.
+1 for the feature
@PhilJay Hi Philipp, any news on this ?
I need to show time on the x-axis, but in multiples of 5 minutes (00 - 15:00 - 30:00 as opposed to 00-
14:38, etc...)
Thank you!
+1
Is this feature available yet?I am looking for such time series as well. Wonderful library
+1
Yep +1! Please save us @PhilJay
+1 for this feature
Hello, could you please add examples for this? @nekdenis
Using the great port of this already great library on iOS. Would love to have support for XY charts!
+1 This would be a great improvement to the library. XY coordinate is kind of basic of graphing system and its sad that this library doesn't support that.
Yes. I hope you'll be able to add timeseries in future.
I've switched to your library and this is something that is missing. Previously I've been using aChartEngine.
At the moment I'm using simple indexing method. I've got only days so it's pretty simple. But probably there is a better way of doing that.
+1 for this feature. It is indeed a great library. Would love to see support for float values in x axis.
I have the same question. So i change my x values to be equidistant and set to x Axis. Although it looks
work, the callback OnChartValueSelectedListener.onValueSelected can't be called exactly. I'm still finding solution.
@PhilJay any advices? thanks.
+1
+1
+1
+1
+1
+1
We are also just starting to integrate iOS Charts, great library, thank you. We are running into this limitation as well. We have xValues like 0, 0.2, 3, 5.75, 6.5, 10, 40, 66.7. Using the workaround described, we would have to have xValues every 0.1 steps, which would be a lot, to cover a range of 0-600 for example.
Any news on this feature or some other work around that performs well at larger numbers of values?
Thanks.
@PhilJay I think, as a first step, the graph should respect the x-indices put into Entry. It could do this by automatically splitting the graph into [highest x-index] number of increments, then plotting the sparse array of x-indices.
That would allow for relative x-value positioning without instantiating large arrays, which I think is adequate for the majority of use cases here. The drawback is the labels are still attached to the x-indices, as opposed to an actual xy Cartesian graph, but this solution would still be much better than what is available currently.
EDIT: I believe I was mistaken in how the x-indices of Entry work, which actually behaves as I described. I suppose the remaining issue would be the x labels, which should optimally also work with indices to minimize memory impact.
+1 this feature is extra needed
+1
+1
+1
+1
+1
+1
+1
+1 I'm logging data from events so the xAxis is variable and time based.
+1
Great library!
I would really appreciate this feature too.
+1
+1
+1
+1 @PhilJay
in the name of mankind sir, +1
+1
Within the next few weeks v3.0.0 of this library with major changes will be released which is finally going to close this issue, stay tuned :-)
Information very interesting :)
Cyril
Le 10/06/2016 à 16:05, Philipp Jahoda a écrit :
Within the next few weeks v3.0.0 of this library with major changes
will be released which is finally going to close this issue, stay
tuned :-)—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/PhilJay/MPAndroidChart/issues/12#issuecomment-225190713,
or mute the thread
https://github.com/notifications/unsubscribe/ALlmhbwUpwdiXXW4GqTb0JW68yoycplIks5qKW8WgaJpZM4CN54o.
Des logiciels Android à découvrir:
Pour la sécurité de votre bateau
MarineSecurity et MarineSecurityMap : http://marinesecurity.free.fr
Pour la mesure de votre vitesse et l'optimisation de vos performances à moto/ski, voiture ou en bateau
SpeedMeter : http://androidapp.free.fr
@PhilJay this branch https://github.com/PhilJay/MPAndroidChart/tree/remove_xindices ?
This issue being closed, does this mean that the master branch has this implemented now?
Yes, & the latest release.
Has this changed other things? Previous parts of my code that used LineData(List<String>, List<ILineDataSet>); now no longer work (doesn't compile, doesn't seem to like my use of the list of strings for the x labels anymore) -- is there anything in the FAQ that shows how to correctly use the new way?
@androidhopeful check out the updated samples
@PhilJay First wanted to say thank you for this update. Time series is something I've waited for for a long time in this awesome library, so thank you for implementing it!
My initial questions / issues seen:
Is there a way to allow newlines in the x-axis labels? As a result of switching to the new time format to allow the hour/minute/time of day (dd MMM h:mm a), there's now a great deal of text crowding unless I manually set xAxis.setLabelCount() to something very small (like 3). It'd be great to be able to render something like dd MMM\nh:mm a instead.
Also, for time/values, forcing floats seems to lose precision in some contexts (for example I've gotten it to spit out 5:23 PM for a timestamp that is actually 5:24 PM, value 1467753840000). Even if you use new Entry(long, float) when inserting timestamp and value into the data set, it converts the timestamp to a float behind the scenes, which gets mangled later if you want to retrieve that value later through things like onValueSelected of OnChartValueSelectedListener or if you want to graph two values that happen to be a minute or two apart -- since there does not seem to be a long, float constructor for Entry, just float, float.
It does not work for you because the Entry constructor changed as mentioned in the release notes.
Its now Entry(float x, float y)
instead of Entry(float y, int xIndex)
TimeStamp to Date format conversion can be done using AxisValueFormatter. (@Phil, correct if am wrong)
But does getFormattedValue() supports new line character?.
This issue https://github.com/PhilJay/MPAndroidChart/issues/73 is still open.Allowing new line character reduces the label length and allows more labels in XAxis.
@PhilJay I got that to work, yes, but using float for timestamp means you lose precision and get incorrect times
@androidhopeful we aren´t as far with the timestamp to loose data there when converting the timestamp long to a float.
@FabianTerhorst The minute level is where it begins to lose precision from what I can tell
@androidhopeful with a timestamp thats in seconds that shouldn´t be the case.
Exactly, you can simply use "second" timestamps and then multiply them by 1000 when using them with a java Date object.
There are plenty of good reasons why this library uses float, and not double or long. I have explained them already.
@PhilJay Point taken. Is there a workaround to allow newlines in the X-axis labels or is that pretty much hardwired?
Please share your sample to set the date and time value in X-Axis. Now it's not working fine when i tried to convert date object to float (For Entry)and vice versa(AxisValueFormatter). I required this option for most dynamic moving chart based on limited interval like 30sec,60sec. I have spent lots of time on it but till now no success.
Thank you for adding this feature. Is there an example on how to use this new feature?
how to set YAxis accuracy 0.01 in mpandroidchart -LineChart ?

Facing the same issue
+1, I am looking for the same feature as well
Most helpful comment
Within the next few weeks v3.0.0 of this library with major changes will be released which is finally going to close this issue, stay tuned :-)