Androidplot: Improve Axis layout (remove cutoff values) - android

On Androidplot my Axis Vals are cut off, so the last values are only shown half.
How to fix this issue?

In case the solution by Coretek doesn't work for you, as it did not for me, I found this solution to produce the desired output:
YOURPLOT.getGraphWidget().setGridPaddingRight(AmountOfSpaceDesired);
YOURPLOT.getGraphWidget().setGridPaddingTop(AmountOfSpaceDesired);
This will not just move your axis to no longer be cut off, but also your graph. I wanted a little extra space on the top where I previously had a point touching along with the right side where another point was touching.
I hope this can help someone as it has helped me.

dynamicPlot.getGraphWidget().setMarginTop(4);
dynamicPlot.getLegendWidget().setHeight(14);
Luckly I still found something in the androidplot forums cache.

Related

How to draw all x-axis labels in a BarChart

I'm using the great mpandroidchart libs for drawing various graph in our apps and first of all I'm deeply sorry if this question will be redundat or stupid.
Anyway, I have this BarChart which is drawing great except to the fact that i can't find a way to force the drawing of ALL XLabels. It just draw some of them and obviously if I pinch the view they are coming up but i would like to show them always, without the needs of zooming.
Hope is much clear. Thanks
Unfortunately there is no way to force draw all x-axis-labels. The chart will prevent overlapping labels from being drawn.
What you can do is reduce the space between the labels to the absolute minimum by calling:
XAxis xa = chart.getXAxis();
xa.setSpaceBetweenLabels(0); // space in characters
This will make sure the space between the labels is kept to a minimum. Default space between labels is 4 characters.
I know the question is a bit older... But the posted solution didn't work for me.
I used:
XAxis xa = chart.getXAxis();
xa.setLabelsToSkip(0);
And this worked perfectly! Hope it helps somebody ;)

andengine polygon body and box2d collision

I recently changed my bodies from rectangle to polygons
and got a weird bug and I can't figure it out why its happening.
When my "player" body touch another body - with a negative angle he just stack on it.
My player X velocity is always constant 5
when I'm switching the body back to rectangle it working fine
Does any one fimiliar with this bug? or have any idea what can cause it?
Found a bug in andengine:
When I put 3 point in the same button line this will cause the bug I write above:
To fix that you need to make sure that on evry line on the poligon there are only 2 points!
Works fine now :)

display negative x-values in AndroidPlot

I want to create a coordinate system like this:
http://xahlee.info/SpecialPlaneCurves_dir/CoordinateSystem_dir/rectangular_coord.png
I tried creating it with AndroidPlot, but I couldn't figure out how.
My main problems: I can't figure out how to draw negative x-values and how to keep the x/y-axis permanent on the screen, even when zooming.
Does someone have an solution for this?
Try this
plot.centerOnDomainOrigin(0);
plot.centerOnRangeOrigin(0);
where plot is XYPlot .

Using achartengine to draw a bar graph but my last bar is squeezed out?

When drawing the bar chart I end up with the last bar being squeezed out of frame, regardless of whether the orientation of the x-axis is vertical or horizontal. I have disabled panning so maybe this has something to do with it but enabling it is not an option.
It looks like this:
I've tried changing the margins/bar width and adding a dummy empty value to the end of the dataset, but the problem persists. Is there a setting somewhere to fix this?
EDIT - I found I can actually add a dummy empty entry at the end of the series and this fixes the problem (long story short I forgot I was limiting the length of the x-axis), but this is a rather ugly solution so if anybody knows of a better one please don't hesitate to inform us!
Thanks in advance!
Half of the bar is outside of the viewable part of the chart.
Set setXAxisMax to your series .getMaxX +1 or 0.5 or equivalent for the YAxis usually fixes this kind of problems.
If you add a dummy value you might get a tiny line at the bottom of the graph.

Android Speedometer (Needle Gauge)

Creating a simple app that calculates the speed your going and displays it in a speedometer graphic. I can do all the speed calculations, gps calculations etc.. but i am not too sure about the animation. Does anyone have any good tutorials or examples on needle gauges other than the thermometer example out there?
I know, the post is quite old. But I had the same situation: there is no a good control for representing speed. I guess many people are facing this.
I've implemented SpeedometerView myself: a simple speedometer with needle and colored value ranges. Feel free to download!
https://github.com/ntoskrnl/SpeedometerView
This control was used in my app CardioMood.
The code is not optimized, but works. Enjoy!
Check here. It is my code. If you have any question please let me know.
Visit https://github.com/mucahitsidimi/GaugeView
You can implement Gauge to your project simply.
<com.sidimi.mucahit.gaugeview.GaugeView
android:id="#+id/gaugeView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
You can set width and height what ever you want to. It will calculate everything automatically.
Check the solution i found for my case.
Big thanks to the owner Evelina Vrabie...
You could probably start with something like this.
Then when transitioning between values, do an animation where the needle gradually moves to the next value X units per unit of time.
This question is also very similar to yours.

Categories

Resources