Androind linechart displaying X amount of values per Range - android

My questions is that I would like to display X amount of values per range so lets say I have range of 1000 values and I would like to display only 100 of them so It would make some sort of averages between them and display them is that possible ?

Related

AChartEngine dates on X-axis with BarChart or CubeChart

I'm trying to make a chart with dates on x-axis and consumption per time month/day etc. on y-axis.
I have database of actual states of energy meters in specific datetime:
1.1.2014 - 150 kWh
5.1.2014 - 200 kWh
So I can get consumption/time like - 50/5 => 10 kWh/day for time from 1.1. to 5.1.
I guess I need some resolution, for every day for example (better for every hour), and add the value of consumption in every hour from 1.1. to 5.1.. But then I need to have that resolution on x-axis labels, 1,2,3...31 day of month etc. But I want to achieve that on zoom out I would have another resolution, means another labels on x-axis. Months. Like 1,2,3..12 And values of consumption with lower resolution, rounded in specific months.
I really don't know how to do that, if it's even possible?
I would like to achieve X-axis label in zoom (better for hours in higher zoom):
And X-axis labels for zoomed out, like on this graph:
Do I need to make my map of x-axis labels for whole times (where I have data of consumption) and then fill it with counted values somehow?
PS: I want to achieve this X-axis labels with Bar chart or Cubic line (cube) chart.
Thanks for any tips

Android Graph with irregular X axis values

I have tried to see if I can do this on AndroidPlot, HelloCharts and MPAndroidChart.
I have a Weight Management App and want to show a chart of how weight has changed over time.
I've just started looking at this and am falling at the first hurdle of plotting irregular intervals on the X axis. All of the examples for all of these seem to show linear plotting with every interval on the X axis having a value plotted.
But my users might weigh themselves everyday for a week and then wait a month before the next weight so there should be a linear date scale and weights mapped against it but with many days not having a value to plot.
Am i missing something obvious or is this something that these libraries just don't do and I will have to look at building it from scratch?
What you could do is simply fill your x-values array with all days up to the current day, beginning from the first day the person weighed himself. (this will support one weight entry per day - if a person weighs himself more often than once a day, you can simply take the e.g. highest value and display it in the chart, and only show the others upon clicking the chart entry)
ArrayList<String> xvals = new ArrayList<String>();
for(int i = startingday; i < currentday; i+= oneday) {
xvals.add(daystring);
}
Each entry in this x-values array will represent one day, in indices from 0 to the last day.
If you want to add the weight measurement for the first day, create a new Entry with x-index 0 and the weight value. If you want to add the weight measurement for the 10th day, add a new Entry with x-index 10 and the weight value.

How can i customize the layout and position of X axis when drawing a graph using achartengine

I want to construct a graph using achartengine library showing some values corresponding to date/time.
The date axis(behaving as X axis) should be present on the top.
Also i want to customize the layout of X axis.
I want to show the date on X axis above and for each date there are certain time intervals.
Example : I want to plot the readings every 4 hours every day . I want to distinguish the readings day wise as well as hour interval wise.
I hope I am clear.
Can somebody please help me in achieving this ?
Thanks !

AChartEngine: "Auto-scaling" a chart with multiple Y-axes

I'm using AChartEngine's TimeSeries to display four separate series of values. The "values" have vastly varying scales - one of them is a fraction (varies between 0 and 1), the other has a range of 0 to 1000.
Now, I want to display all four of them simultaneously. I have been able to do this, but the problem is the line for the fraction is always hugging the X-axis since the variation between 0 and 1 is indistinguishable when the Y axis is from 0 to 1000.
One solution I though of was that I'd convert all the values to a common scale before adding them to the series. That way, all the four lines are always on the same scale. I can get rid of the Y-axes altogether. Cool.
But this presents another problem: I also allow the user to select individual series to view; and this time, I want to
Display the individual Y-axis
Display the un-scaled values.
But, since I added scaled values, the chart has now lost the original values and will only display the scaled value.
So, my question is: Is there a way to scale the values on the Y-axes when multiple series are being charted, and to revert to the un-scaled values when the single series is shown?
Also, how do I hide only the Y-axes while still displaying the X-axis?
You can use the multiple scale charting in AChartEngine. The chart type is CombinedXYChart. You can see an example here.
Another thread explaining this approach is this.

LineGraph Using Android plot

I have create simple line chart using Android Plot library.
what i want to do is:
set X range Upto Seven results(I have done this).
and set max value of Y is 100.
currently it takes max value of array as max Y value.
i want like this:
any suggetion?
Thanks...
I think the answer is that you are confusing the number of data points with the maximum value of the axis. Your x-axis is just the number of data points, it has not value as such. The y-axis will contain the same number of points - however I believe you want to set the maximum value of the y-axis to 100 because it is a percentage. You can do this by using setRangeBoundaries

Categories

Resources