achartengine

Android - aChartEngine getCurrentSeriesAndPoint() not working for disconnected graph

偶尔善良 提交于 2019-12-06 05:54:00
I am plotting the wind direction as a xyseries in a TimeChartView using aChartEngine along with windspeed (windspeed is a timeseries using left y-axis, winddir is XYSeries using right y-axis). The problem I am facing is that as the windirection passes north, my values shift between 0 and 360, creating an ugly vertical line in my graph. I would prefer that if the values increased above 360 the graph just got clipped and resumed at 0. By filtering the values and inserting MathHelper.NULL_VALUE in my XYSeries (see code) I managed to get the graph as I wanted double windDirTemp=0; ... if (Math.abs

Error: eglSurfaceAttrib not implemented

≯℡__Kan透↙ 提交于 2019-12-06 04:18:24
I am trying to display a line graph using aChartEngine, however, the page is coming up blank and I am receiving the error "eglSurfaceAttrib not implemented" Code for Progress(display) page: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical

Achartengine - different Bar Color for BarChart in android

瘦欲@ 提交于 2019-12-06 03:48:57
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 Rahil2952 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. 来源: https://stackoverflow.com/questions/15631408/achartengine-different-bar-color-for-barchart-in-android

Android achartEngine how to highlight particular chart element

混江龙づ霸主 提交于 2019-12-06 01:46:16
Hi i am using achartengine's pie-chart to represent my actual sales, now as my app starts one of the chart element in the piechart should get highlighted, like when we do the onclick on pie chart. Below is the code for my piechart final DefaultRenderer renderer = buildCategoryRenderer(colors); renderer.setPanEnabled(false);// Disable User Interaction renderer.setLabelsColor(Color.BLACK); renderer.setShowLegend(true); renderer.setLegendTextSize(20); renderer.setInScroll(true); renderer.setStartAngle(180); renderer.setChartTitle("Sales By Market Segment- Month"); renderer.setLabelsTextSize(22);

How to plot a bar chart in android?

落爺英雄遲暮 提交于 2019-12-05 22:31:03
I have created a bar chart using achartengine but the values plotted in the graph is static. Now i have created a database using sqlite and i want to draw the bar chart using the values from the database and refresh it every 1 min so that it plots new values if any. I am posting my code below. Please guide me on how to modify the code so that i can do the above. I tried many tutorials online but it didnt help much. package flu.solutions.travelsense; import java.util.ArrayList; import java.util.List; import org.achartengine.ChartFactory; import org.achartengine.chart.BarChart.Type; import org

Changing the legend size in AChartEngine

帅比萌擦擦* 提交于 2019-12-05 15:56:09
I would like to specifically change only the legend size outputting for a Pie Chart. I've tried all methods I can find for AChartEngine, but none of them only change the legend text size. Do I have to override the onDraw function? If so, how? For setting the legend height use: renderer.setLegendHeight(height); You can also have the legend take only the exact space it needs: renderer.setFitLegend(true); To change the legend text size: renderer.setLegendTextSize(textSize); To change the value of chart renderer.setChartValuesTextSize(textSize); 来源: https://stackoverflow.com/questions/17818945

Highlighting Pie Chart Slice When Clicked in AChartEngine

◇◆丶佛笑我妖孽 提交于 2019-12-05 15:53:49
I want to highlight (change color) of a pie graph specific slice when clicked by the user. I can find in the samples (the code below) that it is possible to show the index of the slice and the exact point. but what about recoloring the slice ? mChartView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { SeriesSelection seriesSelection = mChartView.getCurrentSeriesAndPoint(); if (seriesSelection == null) { Toast .makeText(PieChartBuilder.this, "No chart element was clicked", Toast.LENGTH_SHORT) .show(); } else { Toast.makeText( PieChartBuilder.this, "Chart

Achartengine on android - multiple Y axis

廉价感情. 提交于 2019-12-05 08:54:15
Having a hard time getting multiple Y axis to show up on a chart using achartengine on android. I have tried to copy what was done on the "Multiple Temperature Chart" demo here: http://code.google.com/p/achartengine/source/browse/trunk/achartengine/demo/org/achartengine/chartdemo/demo/chart/MultipleTemperatureChart.java but it won't show the Y axis on the right, nor will it show the Yaxis labels I want to show. Any ideas what my code might be doing wrong: mCurrentCostSeries = new XYSeries(costTitle); mCurrentEffSeries = new XYSeries(effTitle); mDataset.addSeries(mCurrentCostSeries); mDataset

Label Text size according to the screen size in a chart engine pie chart in android

你说的曾经没有我的故事 提交于 2019-12-05 04:09:45
I am successfully displaying pie chart using achart engine.I want to customize my labels text size according to the screen size.Thanks in advance. You can set the labels text size this way: renderer.setLabelsTextSize(size); You will have to find the best logic for finding the best proportion between the screen size and the labels size. This problem comes down to resolution. achartengine seems to have been designed with raw pixels in mind while display quality and pixel density has increased dramatically over the last couple years. The labels from the achartengine sample are tiny on my HTC One!

setting line thickness for a graph - Achart engine

谁说我不能喝 提交于 2019-12-05 02:46:02
问题 I am using AchartEngine for my android phone applications. Everything looks fine but the thickness of a line for the rendered graphs does not appeared to be good. I wanted to increase the thickness for these graphs. 回答1: OK, I got the answer. It should be something like below: int length = renderer.getSeriesRendererCount(); for (int i = 0; i < length; i++) { XYSeriesRenderer seriesRenderer = (XYSeriesRenderer) renderer .getSeriesRendererAt(i); seriesRenderer.setLineWidth(2f); } 来源: https:/