android-graphview

MpAndroidChart set background between limit lines

不想你离开。 提交于 2019-12-11 13:13:17
问题 I a using MpAndroidChart library. I need to implement a design where I need to color the area between two limit lines. I have attached an image for reference. I have tried multiple ways but I have failed to achieve it. I am using this library for the first time. Can anyone help me about how this could be achieved. As you can see the green shade behind the line graph. Which is the limit. I need to get that green shade Thanks in advance, Anudeep Reddy. 回答1: I don't think that there is a direct

Graphview in Eclipse Can the X & Y Axis use different LabelFormats?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 11:49:12
问题 I have a graph and I need the Y axis to display to 1dp. This works by doing the following code. NumberFormat nf = NumberFormat.getInstance(); nf.setMinimumFractionDigits(1); graph.getGridLabelRenderer().setLabelFormatter(new DefaultLabelFormatter(nf, nf)); I need the X axis to display 2 strings, 1 at the beginning and 1 at the end. This works by doing the following code. StaticLabelsFormatter staticLabelsFormatter = new StaticLabelsFormatter(graph); staticLabelsFormatter.setHorizontalLabels

Android GraphView 4.x - Bar Graph Not Fitting

萝らか妹 提交于 2019-12-11 07:21:19
问题 I am using the 4.x version of GraphView in my Android app. I have a bar graph with 7 data points and the first and last bars are being cut off. Here is my code private static final String[] WEEK_DAYS = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; private void showChartData() { ChartData[] data = new ChartData[7]; for (int x = 0; x < 7; x++) { data[x] = new ChartData(); } data[0].setEnrollmentCount(2); data[1].setEnrollmentCount(4); data[2].setEnrollmentCount(6); data[3]

Could not add addView in android

孤人 提交于 2019-12-11 03:44:55
问题 I need help friends. Here is my activity public class MainActivity extends Activity { float values[] = { 700, 400, 100, 500, 600 }; float values1[] = { 70, 40, 10, 50 }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); LinearLayout lv1 = (LinearLayout) findViewById(R.id.linear); values = calculateData(values); values1 = calculateData(values1); MyGraphview graphview = new MyGraphview(this, values); graphview

Android/Java creating a helper class to create graphs

一世执手 提交于 2019-12-10 19:32:08
问题 Goal: To create a helper class for graph generation Background: I have 3 fragments that each collect some sensor data (accelerometer, gyroscope, rotation) and plots a graph using GraphView. Here is what the code looks like for one of those fragments (this code currently works correctly): public class GyroscopeFragment extends Fragment implements SensorEventListener { private final short TYPE_GYROSCOPE = Sensor.TYPE_GYROSCOPE; private final short POLL_FREQUENCY = 100; //in milliseconds private

how to plot a graph with a CSV file?

微笑、不失礼 提交于 2019-12-08 14:09:37
问题 I want to plot a diagram in android with GraphView library http://www.android-graphview.org/ . but the number of points of diagram is more than 12000 and it isn't possible to add all single points manually. my data saved in storage (with custom format) as shown below : 0.000,116.288 0.008,122.422 0.016,126.721 ... I get the data from https://physionet.org/cgi-bin/atm/ATM with this setting: Signals :ABP Time format :seconds Toolbox :Export signals as CSV and I need to read them from file and

Android: GraphView How do I implement time in the X axis?

此生再无相见时 提交于 2019-12-08 01:36:43
问题 I'm finding it a bit difficult to figure out how to implement time in the X Axis of a graph in Android? This is my code: for (int i = 0; i < listSize; i++) { String[] onlyReading = mData.get(i).getReading().split(" "); readingList[i] = Double.parseDouble(onlyReading[0]); String date = mData.get(i).getUnFormatedDate(); String[] temp = date.split(" "); String[] dateTemp = null; String[] timeTemp = null; if(temp.length > 0) { dateTemp = temp[0].trim().split("-"); timeTemp = temp[1].trim().split(

Difficulty in understanding complex multi threading in Android app

丶灬走出姿态 提交于 2019-12-07 13:39:59
问题 I have big problem with understanding multi threading in my application and because of that finding a bug. I've checked I think all possibilities and still I am getting various (sometimes unexpected) errors. Maybe someone here will be able to advice me, what I should do. In my project I am using two external libraries: GraphView - provides views for graph drawing EventBus - provides interface for easy communication between app components As for the app it has the structure like this:

Android: GraphView How do I implement time in the X axis?

谁说我不能喝 提交于 2019-12-06 14:03:07
I'm finding it a bit difficult to figure out how to implement time in the X Axis of a graph in Android? This is my code: for (int i = 0; i < listSize; i++) { String[] onlyReading = mData.get(i).getReading().split(" "); readingList[i] = Double.parseDouble(onlyReading[0]); String date = mData.get(i).getUnFormatedDate(); String[] temp = date.split(" "); String[] dateTemp = null; String[] timeTemp = null; if(temp.length > 0) { dateTemp = temp[0].trim().split("-"); timeTemp = temp[1].trim().split(":"); Date dateObj = new Date(); String year = "0"; if(dateTemp != null) { dateObj.setDate(Integer

Difficulty in understanding complex multi threading in Android app

给你一囗甜甜゛ 提交于 2019-12-05 22:38:00
I have big problem with understanding multi threading in my application and because of that finding a bug. I've checked I think all possibilities and still I am getting various (sometimes unexpected) errors. Maybe someone here will be able to advice me, what I should do. In my project I am using two external libraries: GraphView - provides views for graph drawing EventBus - provides interface for easy communication between app components As for the app it has the structure like this: MainActivity / \ / \ Thread Fragment (ProcessThread) (GraphFragment) The idea is that ProcessThread computes