achartengine

customizing Piechart displayed by using ChartEngine

亡梦爱人 提交于 2019-12-02 08:11:49
I am successfully displaying charts by using Chart Engine but I am suffering from below problems: I am unable to reduce the Chart Size. Chart is moving on the screen but I don't want that. I want to display one more image in the bottom of the screen but here chart is displayed in the middle of the screen. I just want to display chart at the top and below image(How to set margins). Please any one can help me.Thanks in advance. Following is my code: public class MainActivity extends Activity { private String[] mMonth = new String[] { "Jan", "Feb" , "Mar", "Apr", "May", "Jun", "Jul", "Aug" , "Sep

android achartengine : trying to export graph as image throws exception

橙三吉。 提交于 2019-12-02 08:04:33
问题 in an android app, am attempting to export the graph (which I drew using achartengine) as Bitmap object via this code public static Bitmap loadBitmapFromView(Context context, View view) { Bitmap bitmap; BitmapFactory.Options options = new BitmapFactory.Options(); options.inPurgeable = true; options.inInputShareable = true; Bitmap dummy = null; try { dummy = BitmapFactory.decodeStream(context.getAssets().open("icon_add.png"), new Rect(-1,-1,-1,-1), options); } catch (IOException e) { e

Radius of Doughnut chart in AchartEngine

吃可爱长大的小学妹 提交于 2019-12-02 03:30:31
问题 I m trying to set doughnut chart inner circle radius and outter circle radius in aChartengine, below is my code : public class MainActivity extends Activity { GraphicalView gv; RelativeLayout rl; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); List<double[]> values1 = new ArrayList<double[]>(); values1.add(new double[] { 15, 5 }); gv = createIntent(values1); rl = (RelativeLayout) findViewById(R.id.rel);

Radius of Doughnut chart in AchartEngine

筅森魡賤 提交于 2019-12-02 02:31:45
I m trying to set doughnut chart inner circle radius and outter circle radius in aChartengine, below is my code : public class MainActivity extends Activity { GraphicalView gv; RelativeLayout rl; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); List<double[]> values1 = new ArrayList<double[]>(); values1.add(new double[] { 15, 5 }); gv = createIntent(values1); rl = (RelativeLayout) findViewById(R.id.rel); rl.addView(gv); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this

AChartEngine does not display the maximum chart value

馋奶兔 提交于 2019-12-02 02:18:42
I am trying to display horizontal bar chart using AChartEngine. In the bar chart, ChartValues should be displayed. (I am using XYSeriesRenderer.setDisplayChartValues(true) in my code.) Following is the rendered chart. As you can see, the maximum value is not displayed. I think the length of the x-axis (about 140) region is not enough to display the region of maximum chartvalue. Anyway, how can I display the maximum chartvalue in my chart? Here's my code. renderer.setColor(Color.parseColor("#158aea")); renderer.setDisplayChartValues(true); renderer.setChartValuesTextSize(15); renderer

aChartEngine, GraphicalView OnClickListener not working

南笙酒味 提交于 2019-12-01 23:02:12
问题 I'm new to android and am using aChartEngine to create a bar chart. I want to capture the x and y values when a user clicks on the chart. I have looked at the demos from aChartEngine and have my chart creating fine. However the onClickListner does not work when I click on the graphy. I have defined the listener in the OnResume method but it doesn't work. Any ideas would be greatly appreciated. Am I missing something here? Here is my OnResume method which is taken from XYChartBuilder @Override

aChartEngine, GraphicalView OnClickListener not working

北战南征 提交于 2019-12-01 20:54:55
I'm new to android and am using aChartEngine to create a bar chart. I want to capture the x and y values when a user clicks on the chart. I have looked at the demos from aChartEngine and have my chart creating fine. However the onClickListner does not work when I click on the graphy. I have defined the listener in the OnResume method but it doesn't work. Any ideas would be greatly appreciated. Am I missing something here? Here is my OnResume method which is taken from XYChartBuilder @Override protected void onResume() { super.onResume(); Toast.makeText(Clickable2.this, "In OnResume", Toast

scatter plot with dates at x axis — add custom labels on X axis

时光总嘲笑我的痴心妄想 提交于 2019-12-01 14:53:12
I want to have a scatter plot with dates in x-axis. Because if I use ChartFactory.getTimeChartView I receive a line graph and the problem is: I make plot with current date as x axis and data (user input) as y axis.I store these data (date and user data) in Lists and also in a file. The user may enter multiple times data during a day.And some of the data may be the same,so if I use a Linegraph the plot messes up.That's why I need scatter. 1)How can I do this? 2) Also, can someone point me to an example of adding custom labels on the X axis,in order to use a Linegraph? ---------------------

Generating graph by using remote data from database on achartengine

ⅰ亾dé卋堺 提交于 2019-12-01 11:39:47
I am trying to generate a graph using achartengine which pulls the data from a database and populates the graph using the data. Following is the code that populates the graph. All tha data is stored in "dataArraylist". This code populates the data into graph CategorySeries series = new CategorySeries("Bar Graph"); //"series" = graph for(int i=0; i< size; i++) { series.add("Bar"+(i+1), dataArraylist.get(i)); //add each of the value to the series i.e graph } XYMultipleSeriesDataset dataset= new XYMultipleSeriesDataset(); dataset.addSeries(series.toXYSeries()); //add the graph into a dataset //

Generating graph by using remote data from database on achartengine

邮差的信 提交于 2019-12-01 10:39:08
问题 I am trying to generate a graph using achartengine which pulls the data from a database and populates the graph using the data. Following is the code that populates the graph. All tha data is stored in "dataArraylist". This code populates the data into graph CategorySeries series = new CategorySeries("Bar Graph"); //"series" = graph for(int i=0; i< size; i++) { series.add("Bar"+(i+1), dataArraylist.get(i)); //add each of the value to the series i.e graph } XYMultipleSeriesDataset dataset= new