I have about 12 domain labels in single graph. They overlap one another. I am not able to change their orientation. Please suggest a solution which will work with Android v2.2 and beyond.
Try this way,
plot.getGraphWidget().setDomainLabelOrientation(-45);
Here is the solution to rotate domain labels so that they don't overlap each others:
plot.getGraph().getLineLabelStyle(XYGraphWidget.Edge.BOTTOM).setRotation(-45);
This works using the newer version of AndroidPlot (1.0 and above)
I realize you asked this quite awhile ago, but this might help someone out there.
You can create your own labels as seen here: AndroidPlot : setting the labels on the X-axis
Or if you want to just have less domain value, you can set the domain values by using this:
yourPlotName.setDomainStepValue(NumberOfValuesDesired);
Related
I am creating a line chart using MPAndroidChart, all is working great, but I've noticed that at the labels often become bunched up. I know there is a way to prevent this (I've seen other apps that don't have this issue,) but I don't know what setting to enable.
There are a couple of ways you could make the labels fit better.
Decrease the text size of the X axis labels with mChart.getXAxis().setTextSize(float)
Set a label count limit for the X axis using mChart.getXAxis().setLabelCount(int). This should work fine, as you are already not showing one label per data point.
Change the date format of your label.
Some, all or none of these might help you, depending on your requirements. Good luck!
I'm using the WilliamChart library for Android.
Everything works perfect and now I want to set the axis color to white. I've tried with the following but that didn't change it:
chartview:chart_axisColor="#fff"
How can I change the axis color?
My second problem is that I have a chart where the numbers are higher than 500 but all about the same. So now I have all the dots of my line on top since the chart starts at 0.
Can WilliamChart figure out my lowest and highest number and fit the points in between?
I think I saw this somewhere but I couldn't find it in the example or the docs.
About the color, you're doing it right, so assuming you also defined:
xmlns:chartview="http://schemas.android.com/apk/res-auto"
it should work (if not raise the issue on github). The sample application has an example of it as well.
If you don't define any minimum and maximum value the library must calculate what they are. Perhaps you are defining them yourself with setAxisBorderValues and in that case the lib assumes those as correct.
Its been almost two days m struggling to use compound graph with following features:-
graph with stacked bar and line chart together.
Two y-axis (one at right and other at left) with differnt data set.
Tooltip that display current touched coordinates of graph.
I had tried following android graph libraries:-
MPAndroidchart
This library doesnt supports compound graphs. But i love this library, since rest features are up to the mark.(wish this would had supported Compond graphs.)
AndroidPlot
It does support Compound graph but no tooltip and multiple y-axis.
AchartEngine
Supports compound graphs. Look and feel is not that good. No tooltip support. Support Heap bar(stacked) but you cannot use this along with any other chart type in same graph.
So, is there any other library that can match my requirement ?
or
how could i implement this using libraries that i mentioned.
I'm fairly sure that HelloCharts can do all of this. The demo app shows a "Combo Line/Column Chart" to satisfy point 1 and a "Speed Chart" to satisfy requirement 2. Point 3 works in all their charts from what I can tell.
The only thing I'm not 100% sure about is if the ComboLineColumnChartView also supports two Y-axis like the LineChartView, but I don't see why not. Let me know if it works.
I've been working with Androidplot library for generating line plots and be able to do zoom and pan, so I'm using a modified version of XYPlotZoomPan class.
My current chart is showing some values per day, in a range of dates, so if I'm showing 7 days the domain axis is readable but if I'm trying to show 30 days it turns into a mess.
My goal is to show 7 days and have the option of scrolling through the rest of the chart that is not shown.
The only function that handles boundaries is setDomainBoundaries, currently I've tried this:
setDomainBoundaries(min, max, BoundaryMode.FIXED);
But it lets me show values inside this range and I'm loosing the ability for panning through the rest of the days.
Does someone have an a idea how I can do that? Thanks.
You can create your own domain value format with myplot.setDomainValueFormat(Format f). From here you can create your own formatter.
Another option you can look at is setDomainStep, a good example of that can be found here
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.