How to rotate the x-axis label of bar-chart in android? - android

I'm using chart engine library to draw bar chart. X-Axis label has text values and it required more space. How can I tilt the x-axis values.

Have you tried:
renderer.setXLabelsAngle(ANGLE);
Where ANGLE is your desired text angle?

Related

XAxis label angle in MPAndroidChart causes chart to move up

When i use xAxis.setLabelRotationAngle(-45); to rotate the labels of the xAxis on a bar chart,it causes the chart to jump up on the charts.BarChart control.
Chart without label rotation
Chart with label rotation
How do i prevent this from happening while keeping the rotation?

MPChart: x axis couldn't display date completely

I have a problem using MPChart :
x axis couldn't display the first date,could someone help me?thanks!
You can use the setAvoidFirstLastClipping(Boolean) from your chart to avoid your first and last labels to be truncated.
From the doc:
setAvoidFirstLastClipping(boolean enabled): If set to true, the chart will avoid that the first and last axis label entry in the x-axis "clip" off the edge of the chart or the screen.

How to Increase X or Y axis label sizes in AChartEngine in Android and Enable zoom

I have the whole line chart working. However the fonts are really small for the labels in x axis and y axis and also on the points where it is plotted. I've circled them in the picture in order to let you know what labels I am talking about.
Also I have disabled the zoom buttons, however we can still zoom using our fingers on the screen. When I zoom in the chart gets messed up. How do I not allow any kind of zooming?
You can set labels size in pixels for 2 axis together
renderer.setLabelsTextSize(float textSize)
Also you can set label color, align gor X and Y axis, for example:
renderer.setXLabelsColor(Color color);
renderer.setYLabelsAlign(Paint.Align.RIGHT);

Android afreechart customize XY Quadrants

Here is my problem:
I am using AFreeChart to display a chart in my activity. I am giving only positive inputs to my graph.
So I wanted to show my graph only in
(X,Y) Quadrant not in (X,-Y) Quadrant
(-X,Y) Quadrant and (-X,-Y) Quadrant
Is there any possibility to limit quadrants?.
Can anyone please tell me is there any way to customize Quadrants in AFreeChart?
You need to force the range values for the axes to be positive in order to achieve this, you can set the lowerLimit for your range as 0.0 and upper to the maximum value. Something like below,
axis.setRange(0.0, <+upper limit value>);

bar chart with textual x axis - achartengine

I am using achartengine's bar chart in my application. My x axis is not numeric but has text items. just like the pic shown below. Is there a way to make a bar graph like this using achartengine? Can I only display the text in the x axis and not the scale?
I had a problem with clearXTextLabels() too, try this:
renderer.setXlabels(0);
renderer.addXTextLabel(0,"Electronics");
renderer.addXTextLabel(1,"Medical");
...

Categories

Resources