how to remove spaces between bars? - android

I have developed a bar chart using achartengine library.
Achartengine is rendering the blank values of the series and creating undesired spaces, how to remove that?
Does anyone knows how to stop that??

There are a couple of things you could do:
Use renderer.setBarSpacing(0);
If the above only is not working then make sure none of the series has exactly one item. If this happens then just add an empty bar or one with MathHelper.NULL_VALUE as the value

Related

Achartengine - different Bar Color for BarChart in android

I have created one graph in android using AchartEngine library.
I want to display every Bar with different color.
What can i do, please give me some suggestion..?
Thanks in Advance
Just look at answer given here. In this he is giving different color to only one bar.
Take idea of it and try to make it custom according to your requirements.

Remove series indicator/plot legend AndroidPlot

I realise AndroidPlot has a forum but it isn't the most active so i'll chance my arm here...
I'm trying to remove the series indicator or plot legend from my XY plot using the AndroidPlot library. I don't want to remove the series from the plot itself, just the legend.
I've seen it done on AndroidPlot examples but with the limited documentation it's difficult to find methods to do the stuff like remove the legen
OK I have the following code to do this. This is not tested on the very latest version but hopefully is still good.
if (!mKeyOn)
mDynamicPlot.getLayoutManager()
.remove(mDynamicPlot.getLegendWidget());
if (!mDomainLabelOn)
mDynamicPlot.getLayoutManager().remove(
mDynamicPlot.getDomainLabelWidget());
Looks like the trick is to get the layoutManager.
You can also use Androidplot's XML Styling with Configurator and thanks to reflection remove plot legend by simply specifying it's visibility in XML layout file like this:
<com.androidplot.xy.XYPlot
...
androidPlot.legendWidget.visible="false"
... />
If there is no need to change your legend dynamically, I think it's better to place such a styling in the XML file.
Looking at the code, setLegendWidget only updates the local handle for the LegendWidget but does not update the LayoutManager, which is what is actually invoked when it comes time to do the drawing. If you implement Ifor's (upvoted) suggestion you should have success since it interacts with the LayoutManager directly:
plot.getLayoutManager().remove(plot.getDomainLabelWidget());
Another option is to hide the Legend like this:
plot.getLegendWidget().setVisible(false);
Provided (in light of the info above) that you are not also trying to substitute/remove the legend widget with a previous call to setLegendWidget().
If you want to remove only one (or a specific) series legend from the legend widget simply use:
yourSeriesFormater.setLegendIconEnabled(false);
This worked for me.

How to Draw custom Bar charts in Android

I am developing an application, in which there is a requirement for showing results in a Bar charts. I have tried developing charts using AChartEngine and Google api and many other apis. But my Requirement is to draw multiple charts in one Activity. I followed this.Its working fine. But when i try to set the background image for the whole screen, Its not working
Can Anybody help me please
Just check this Bar Chart in Android With out any Built in jars. Here you can draw charts without any built in jars. Its just simple Graph creation using the concept of setting the height for the textview in a ListView.
I implemented this by using the Horizontal ListView. Here you have the two double arrays with equal size of elements. And the graph will adjust according to the orientation(Portrait and landscape).
If you want more charts in one activity, you can implement another Horizontal Listview in the layout.
I hope this will help you....
i can help you with paid Library which is nice
is called aiCharts (Bar Charts)
or you should refer GraphViewDemo it is also anice and free libraray to make bar graph
GraphViewDemo
I am writing a blog post on the subject. For one of my clients I created a compound view with an embedded bar chart. I did not find a simple and flexible library to achieve this, so I decided to go with custom views. To my surprise, it was simpler than I had expected: create a custom view that takes a colour and a percentage as attributes and use linear layouts to contain its instances, using layout_weight or a fixed layout_width to maintain proportions. I am very happy with the results.

how to change the chart UI when using Achartengine in android?

when using Achartengine for drawing a chart , the function of Achartengine library will just provide a intent, then you just need to jump to the screen pointing by the intent ; yes .... this can be work perfect .. However , the screen is so simple and the style of the chart screen is totally uncompatible with other screen's , and it seems that the Achartengine library doesn't provide any interface to change the chart UI ( not just the color of line or point), can any one tell me some idea to solve this issue...
any help will be appreciated!
bob
The AChartEngine APIs actually allow you create views as well. This means that you can have a chart together with other UI components under the same screen. There is example code in the AChartEngine demo showing you how to do this.
If you apply an application wide theme through your manifest you will inherit some of them. Things like background colors, etc. Otherwise you have to specify your text/axis/line colors through code when setting up the intent.

Android: how to set the chart engine title to two lines?

I am developing an app in which i am implementing Achart engine line chart. Everything is working fine. I want to set the chart title to two lines if it is big title. But there is no option given, to set it to two lines. How can i do that? Can any one of you help me?
I have never been in such situation but seeing you question I did some RnD on the Source code of the AChartEngine open source code.
And I found this two things :
1) in code where they set tile Line no 251
2) and XML file for the same
but there is nothing which can stop the TextView to be more than single line.
I am not enough capable that I file this as bug..
But As far as I understand You will have to figur out something else for you as there is no any other option using the library for this thing.

Categories

Resources