Search Results

Search found 6 results on 1 pages for 'achartengine'.

Page 1/1 | 1 

  • How to remove some of the TimeSeries titles in a AChartEngine Time Series View

    - by user1831310
    As a workaround of not being able to change colors of selected points in a series on an AChartEngine Time Chart, I was using an additional series for each point whose color has to be changed. I need to disable series titles for those additional series. Using empty string as the argument to the Time Series construtor: TimeSeries ts = TimeSeries(""); still results in the line-and-point symbol being placed with empty series title string under the X-axis labels for each such series. It would be a desirable feature for AChartEngine to remove both the line-and-point symbol and the series title string for a series created with a null argument to the TimeSeries construtor call: TimeSeries ts = TimeSeries(null); But this currently resulted in nullPointerException instead. Would the AChartEngine developers consider the above suggestion and until then, is there a way to remove some of the TimeSeries titles from a AChartEngine Time Series View? Best regards.

    Read the article

  • Issue in achartengine jar file

    - by Anshuman
    Actually i have created an app in which i have used achartengine to contruct graph. It was running ok, but today i saw an update for android SDK to r17. Once i upadated the sdk the app i had build started crash. In the logcat i show the following error report. Why this happen, is it because the jar file i have used is deprecated. 03-27 14:44:26.320: E/AndroidRuntime(4360): java.lang.NoClassDefFoundError: [Lorg.achartengine.chart.PointStyle; 03-27 14:44:26.320: E/AndroidRuntime(4360): at in.com.example.ChartEngineActivity.onCreate(ChartEngineActivity.java:58) 03-27 14:44:26.320: E/AndroidRuntime(4360): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 03-27 14:44:26.320: E/AndroidRuntime(4360): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 03-27 14:44:26.320: E/AndroidRuntime(4360): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 03-27 14:44:26.320: E/AndroidRuntime(4360): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 03-27 14:44:26.320: E/AndroidRuntime(4360): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 03-27 14:44:26.320: E/AndroidRuntime(4360): at android.os.Handler.dispatchMessage(Handler.java:99) 03-27 14:44:26.320: E/AndroidRuntime(4360): at android.os.Looper.loop(Looper.java:130) 03-27 14:44:26.320: E/AndroidRuntime(4360): at android.app.ActivityThread.main(ActivityThread.java:3683) 03-27 14:44:26.320: E/AndroidRuntime(4360): at java.lang.reflect.Method.invokeNative(Native Method) 03-27 14:44:26.320: E/AndroidRuntime(4360): at java.lang.reflect.Method.invoke(Method.java:507) 03-27 14:44:26.320: E/AndroidRuntime(4360): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 03-27 14:44:26.320: E/AndroidRuntime(4360): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 03-27 14:44:26.320: E/AndroidRuntime(4360): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • How to convert a AChartEngine chart to bitmap

    - by user2137817
    I want to convert a line graph I made with AChartEngine lib to bitmap.How should I do?I didn't found on the net anything that can help. Is the toBitmap() method suitable?if yes then how to use it? Update: I used this method : public static Bitmap loadBitmapFromView(View v) { v.setDrawingCacheEnabled(true); v.layout( 0,0,800,600); v.setDrawingCacheQuality(View.DRAWING_CACHE_QUALITY_HIGH); v.buildDrawingCache(); v.getDrawingCache(); Bitmap bmp = Bitmap.createBitmap(800,600, Bitmap.Config.ARGB_8888); v.setDrawingCacheEnabled(false); return bmp; } and saved the result in a png file but all I got is an empty file !

    Read the article

  • Axis value changes in barchart while swapping the phone using Achartengine

    - by Vasu
    Hi I have included the Barchart using AchartEngine API .When I swap the orientation of the screen the yaxis value is altered as same values. For eg. initially it is (0,10) , (10,25) but after swapping its changes to (0,10), (10,10) i could not understand why it is happening . And I have place string in x axis instead of numbers , I used addtextlabel method but the string is overlapped on the number . I need to display only the names. could you help on this. I have included my code here. public class Analytics extends Activity implements OnClickListener { private Button settings_btn; private RelativeLayout relativeLayout3; private boolean isClicked = false; private static final int SERIES_NR = 1; static int multiple_of_five; private GraphicalView mChartView; XYMultipleSeriesRenderer renderer; static int value=20; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.analytics); settings_btn = (Button) findViewById(R.id.settings_btn); relativeLayout3 = (RelativeLayout) findViewById(R.id.relativeLayout3); settings_btn.setOnClickListener(this); if (SharedValues.isClicked) { relativeLayout3.setVisibility(View.VISIBLE); } else { relativeLayout3.setVisibility(View.GONE); } renderer = getBarDemoRenderer(); setChartSettings(renderer); if (mChartView == null) { RelativeLayout layout = (RelativeLayout) findViewById(R.id.relativeLayout5); // mChartView= ChartFactory.getLineChartView(this, getDemoDataset(), getDemoRenderer()); mChartView = ChartFactory.getBarChartView(getApplicationContext(),getBarDemoDataset(),renderer,Type.DEFAULT); layout.addView(mChartView,new LayoutParams(LayoutParams.FILL_PARENT, 280)); } else { mChartView.repaint(); } // Intent intent = ChartFactory.getLineChartIntent(this, getDemoDataset(), getDemoRenderer()); // intent = ChartFactory.getBarChartIntent(this, getBarDemoDataset(), renderer, Type.DEFAULT); // startActivity(intent); } @Override protected void onResume() { super.onResume(); } public XYMultipleSeriesRenderer getBarDemoRenderer() { XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(); renderer.setAxisTitleTextSize(16); renderer.setChartTitleTextSize(20); renderer.setLabelsTextSize(15); renderer.setLegendTextSize(15); // renderer.setApplyBackgroundColor(true); // renderer.setBackgroundColor(R.color.chart_bg); // renderer.setMarginsColor(R.color.settings_bg_color); // renderer.setBackgroundColor(getResources().getColor(R.color.background)); renderer.setPanEnabled(false, false); renderer.setZoomEnabled(false, false); renderer.setMargins(new int[] {0, 10, 0, 0}); SimpleSeriesRenderer r = new SimpleSeriesRenderer(); // r.setColor(Color.MAGENTA); // renderer.addSeriesRenderer(r); r = new SimpleSeriesRenderer(); r.setColor(Color.CYAN); renderer.addSeriesRenderer(r); return renderer; } private void setChartSettings(XYMultipleSeriesRenderer renderer) { // renderer.setChartTitle("Chart demo"); // renderer.setXTitle("x values"); // renderer.setYTitle("y values"); renderer.setXAxisMin(2); renderer.setMarginsColor(Color.parseColor("#00F5DA81")); renderer.addXTextLabel(1.0, "Q1"); renderer.addXTextLabel(3.0, "Q2"); renderer.addXTextLabel(5.0, "Q3"); renderer.addXTextLabel(7.0, "Q4"); renderer.addXTextLabel(9.0, "Q5"); renderer.setXAxisMax(20); renderer.setYAxisMin(0); renderer.setYAxisMax(100); renderer.setZoomEnabled(false, false); // renderer.setApplyBackgroundColor(true); // renderer.setMarginsColor(R.color.settings_bg_color); renderer.setBackgroundColor(Color.TRANSPARENT); // renderer.setBackgroundColor(R.color.chart_bg); } private XYMultipleSeriesDataset getDemoDataset() { XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); final int nr = 10; Random r = new Random(); for (int i = 0; i < SERIES_NR; i++) { XYSeries series = new XYSeries(""); for (int k = 0; k < nr; k++) { if(k%2==1) { series.add(0, 0); } else { series.add(k, 20); } } dataset.addSeries(series); } return dataset; } private XYMultipleSeriesRenderer getDemoRenderer() { XYMultipleSeriesRenderer renderer = new XYMultipleSeriesRenderer(); renderer.setAxisTitleTextSize(6); renderer.setChartTitleTextSize(10); renderer.setLabelsTextSize(5); renderer.setLegendTextSize(5); renderer.setPointSize(5f); // renderer.setMarginsColor(R.color.settings_bg_color); // renderer.setApplyBackgroundColor(true); // renderer.setBackgroundColor(R.color.chart_bg); renderer.setMargins(new int[] {20, 30, 15, 0}); XYSeriesRenderer r = new XYSeriesRenderer(); r.setColor(Color.BLUE); r.setPointStyle(PointStyle.SQUARE); r.setFillBelowLine(true); r.setFillBelowLineColor(Color.WHITE); r.setFillPoints(true); renderer.addSeriesRenderer(r); r = new XYSeriesRenderer(); r.setPointStyle(PointStyle.CIRCLE); r.setColor(Color.GREEN); r.setFillPoints(true); renderer.addSeriesRenderer(r); renderer.setAxesColor(Color.DKGRAY); renderer.setLabelsColor(Color.LTGRAY); return renderer; } private XYMultipleSeriesDataset getBarDemoDataset() { XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); final int nr = 10; Random r = new Random(); for (int i = 0; i < SERIES_NR; i++) { CategorySeries series = new CategorySeries("Quadrant"); for (int k = 0; k < nr; k++) { value=value+5; // multiple_of_five=k+5; // Log.i("multiple_of_five", ""+multiple_of_five); // series.add(20 +multiple_of_five ); if(k%2==1){ series.add(value ); } else { series.add(0); } } dataset.addSeries(series.toXYSeries()); } return dataset; } @Override public void onClick(View v) { if (v == settings_btn) { if (SharedValues.isClicked) { relativeLayout3.setVisibility(View.GONE); SharedValues.isClicked = false; } else { relativeLayout3.setVisibility(View.VISIBLE); SharedValues.isClicked = true; } } } }

    Read the article

  • Using AChartEngine library for graphs, not able to get value for diffrent x-axis value

    - by kundan Chaudhary
    public static ArrayList<double[]> Value = new ArrayList<double[]>(); private double[] x = new double[10]; private double[] y = new double[10]; int counter = -1; add.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { counter++; x[counter] = Double.parseDouble(income_1.getText().toString()); y[counter] = Double.parseDouble(income_2.getText().toString()); income_1.setText(""); income_2.setText(""); } }); publish.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (Value != null) { Value.add(x); Value.add(y); Intent intent = salesStackedBarChart.execute(BarChart.this, Value, counter); startActivity(intent); } } }); //and in SalesStackedBarChart.java class public Intent execute(Context context, ArrayList<double[]> values ,int counter) { int count = counter + 1; double fcount = counter + 1.5; String[] titles = new String[] { "Android", "iPhone" }; int[] colors = new int[] { Color.GREEN, Color.CYAN }; XYMultipleSeriesRenderer renderer = buildBarRenderer(colors); setChartSettings(renderer, "Yearly revenue in the last "+count+" years", "Years", "revenue in $", 0.5, fcount, 0, 24000, Color.GRAY, Color.LTGRAY); renderer.setXLabels(count); renderer.setYLabels(10); renderer.setDisplayChartValues(true); renderer.setXLabelsAlign(Align.LEFT); renderer.setYLabelsAlign(Align.LEFT); renderer.setZoomRate(1.1f); renderer.setBarSpacing(0.5); return ChartFactory.getBarChartIntent(context, buildBarDataset(titles, values), renderer, Type.DEFAULT); } // in AbstractDemoChart.java class protected XYMultipleSeriesDataset buildBarDataset(String[] titles, List<double[]> values) { XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset(); int length = titles.length; for (int i = 0; i < length; i++) { CategorySeries series = new CategorySeries(titles[i]); double[] v = values.get(i); int seriesLength = v.length; for (int k = 0; k < seriesLength; k++) { series.add(v[k]); } dataset.addSeries(series.toXYSeries()); } return dataset; } Run this project i get graph with x- axis value: 1,2,3,4,5.... But I want to print value: 2005,2006,2007,2008..... I changed in some code like: setChartSettings(renderer, "Yearly revenue in the last "+count+" years", "Years", "revenue in $", 2005, 2010, 0, 24000, Color.GRAY, Color.LTGRAY); and run project i get value of x-axis like: 2005,2006,2007.... but not get graph bar value. Values of all x-axis are null. How can I make this work?

    Read the article

  • Android : start intent in setOnClickListener

    - by Derek
    I have a button, and this button is going to get the values from EditText, then using this value to start a new Intent protected void onCreate(Bundle savedInstanceState) { textDay = (EditText) findViewById(R.id.textDay); textMonth = (EditText) findViewById(R.id.textMonth); textYear = (EditText) findViewById(R.id.textYear); gen = (Button) findViewById(R.id.getGraph); gen.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { getthisIntent(); } public Intent getthisIntent(Context context) { day = textDay.getText(); month = textMonth.getText(); year = textYear.getText(); date = day + "/" + month + "/" + year; . .// Plot graph using AchartEngine, then return an Intent // . } } }); but i get the error "The method getthisIntent(Context) in the type new View.OnClickListener(){} is not applicable for the arguments ()" Can i get some help? or do i have another alternative solution, when i click the button, then the button pass the values to the new intent, and start it without having a new xxx.java file? Edit This is basically what I am doing now, i need to get the things inserted by user, and plot a graph, the only way i know how to plot graph using AchartEngine is create a new activity with define this public Intent getthisIntent(Context context) To be honest, i dont really know what the hell I am doing, please correct me...

    Read the article

1