MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Support for x values (instead of x indices)

Open onyame opened this issue 12 years ago • 116 comments

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.

onyame avatar Jul 16 '14 20:07 onyame

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

PhilJay avatar Jul 16 '14 21:07 PhilJay

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

onyame avatar Aug 02 '14 19:08 onyame

+1

AndroidGecko avatar Aug 27 '14 10:08 AndroidGecko

+1, looking forward to seeing this feature, the sooner the better : )

SiyiLi avatar Sep 16 '14 04:09 SiyiLi

+1, I am looking for the same feature as well

skadyrov avatar Oct 20 '14 09:10 skadyrov

+1. Very useful feature

nesterov-n avatar Oct 24 '14 12:10 nesterov-n

Just looking for the same feature. Great work, anyway!

pgmo avatar Oct 31 '14 08:10 pgmo

Thanks for the great library. It would be great if you add this feature asap

subairariyil avatar Nov 24 '14 06:11 subairariyil

+1. I'd love this feature!

oinegue avatar Dec 23 '14 21:12 oinegue

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.

nekdenis avatar Jan 19 '15 12:01 nekdenis

+1, I am looking for the same feature as well

dowi avatar Feb 18 '15 10:02 dowi

Hi Guys,

@nekdenis - Could you please discuss the ideas here, I would be glad to contribute using your ideas :)

Thanks,

rajatdeshpande avatar Feb 18 '15 11:02 rajatdeshpande

+1 same here

Ploppy3 avatar Feb 27 '15 16:02 Ploppy3

+1

medy75 avatar Feb 28 '15 15:02 medy75

+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 .

rajatdeshpande avatar Feb 28 '15 15:02 rajatdeshpande

+1

bhspencer avatar Feb 28 '15 18:02 bhspencer

I am looking for an android equivalent to to vis.js graph2d http://visjs.org/graph2d_examples.html

bhspencer avatar Feb 28 '15 18:02 bhspencer

+1

taltstidl avatar Mar 08 '15 16:03 taltstidl

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.

nekdenis avatar Mar 10 '15 09:03 nekdenis

+1

palasjir avatar Mar 12 '15 13:03 palasjir