bar chart with textual x axis - achartengine - android

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");
...

Related

Android MP Chart, Bar Chart Y Axis display from 0.0f

I have following bar chart. I wish to display data from 0.0f - 10.9 in Y Axis. I tried using setLabelCount but it doesnt help. t
there is option of setting maximum and minimum values:
barChart.getAxisRight().setAxisMinValue(3f);
barChart.getAxisRight().setAxisMaxValue(10f);
also:
dataset.setAxisDependency(YAxis.AxisDependency.RIGHT);
because by default graph is dependent on left axis you changed labels range for right axis above and this line will make graph axis dependency w.r.t right axis.

How to plot chart in GraphView with no background?

How to make graphview background completely blank, not even show x axis and y axis.
couldn't find anything on web
I got my solution by adding these lines
mygraphview.getGridLabelRenderer().setGridStyle(GridLabelRenderer.GridStyle.NONE);// It will remove the background grids
mygraphview.getGridLabelRenderer().setHorizontalLabelsVisible(false);// remove horizontal x labels and line
mygraphview.getGridLabelRenderer().setVerticalLabelsVisible(false);
// remove vertical labels and lines

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);

How to rotate the x-axis label of bar-chart in 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?

Categories

Resources