android-graphview

How to add tap listener on data point?

微笑、不失礼 提交于 2021-01-27 18:10:19
问题 I want to a add tap listener on a data point in the graph view in Android Studio . There is a problem in my java code that says: can't resolve method get Activity() in last line of codes. Help me resolve my problem. Here is my code: package com.example.graph; import android.content.Context; import android.graphics.Color; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.widget.Toast; import android.app.Activity; import com.jjoe64.graphview.GraphView;

How to plot a graph with Time in x-axis and value on the other in android?

怎甘沉沦 提交于 2020-01-23 02:50:06
问题 I want to plot a Time vs value graph where time (in hours) is on the x-axis and the Values should be on the y-axis. Is there any library to do this? I tried using achartengine http://wptrafficanalyzer.in/blog/android-drawing-time-chart-with-timeseries-in-achartengine/ but not much helpful. 回答1: you can use GraphView for doing this. http://www.jjoe64.com/p/graphview-library.html https://github.com/jjoe64/GraphView you have to use a Custom label formatter . There's an example where the X-values

Using dates with the Graphview library

徘徊边缘 提交于 2020-01-21 01:43:31
问题 I'm using GraphView library (see: https://github.com/jjoe64/GraphView or http://www.jjoe64.com/p/graphview-library.html) But I would like to use Date/Time for the X-as. Does anyone knows a easy way to accomplish this or can anyone push me in the right direction? 回答1: GraphView is a great library to use, i find it the easiest as well. The first step in doing this would be to add a String Variable in the GraphViewData Class within GraphView.java. Like So: static public class GraphViewData {

Background for each series GraphView

北城以北 提交于 2020-01-16 05:25:10
问题 Im using Graphview and work fine, but now i have a problem. I would like to have a background for each series that is added to the graph, and not for all series Is this possible? 回答1: This is currently (5 August 2014) not possible on the original GraphView library. I needed this functionality, so I forked the library and implemented the functionality myself. You can find the updated code on the feature/series_specific_styles branch of my fork: https://github.com/mobiRic/GraphView/tree/feature

How to reduce the scale of GraphView to one?

那年仲夏 提交于 2020-01-06 06:04:30
问题 I want to reduce the scale of my GraphView to one. I want to be displayed from 0 -> 15, one by one and not 0, 5, 10, 15. This is what I have tried: graphView.getViewport().setYAxisBoundsManual(true); graphView.getViewport().setMinX(-15); graphView.getViewport().setMaxX(15); graphView.getViewport().setXAxisBoundsManual(true); graphView.getViewport().setMinY(-15); graphView.getViewport().setMaxY(15); PointsGraphSeries<DataPoint> series = new PointsGraphSeries<>(new DataPoint[] { //Add DataPoint

Android graphview all x-axis values are set to the latest value

邮差的信 提交于 2020-01-05 10:18:10
问题 I've created a real-time graph, where the values of the x-axis are set to show the time at which the corresponding y-axis values were generated. The graph is constantly updated. The value send to the graph is time in milliseconds. I've created a function which produces the time string in different ways, depending on the time. Here's the code: GraphView heartRateGraph = new LineGraphView(this, "Heart-rate") { @Override protected String formatLabel(double value, boolean isValueX) { if (isValueX

Fill color between two series in a LineGraphSeries of Graphview android

旧街凉风 提交于 2020-01-04 12:15:12
问题 I have created a line graph using GraphView demo.But I need to fill the areas only between the lines with a specific colour. This is what I want to achieve: Error band for a linegraphseries. or Fill colour between two series in a LineGraphSeries of Graphview. Can anybody help? 来源: https://stackoverflow.com/questions/40858555/fill-color-between-two-series-in-a-linegraphseries-of-graphview-android

Getting IllegalStateException when trying to take snapshot of the graph for https://github.com/appsthatmatter/GraphView

情到浓时终转凉″ 提交于 2020-01-02 10:02:21
问题 I'm trying to take snapshot of the GraphView but it gives an error "GraphView must be used in hardware accelerated mode." I'm using the following code to take snapshot Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); view.draw(canvas); Also, i've already set android:hardwareAccelerated="true" at application level. 回答1: i used this: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile

Error in jjoe64 GraphView Library

≯℡__Kan透↙ 提交于 2019-12-25 18:39:20
问题 someone can help me? I found this error and I can't find the resolution to my problem. This is the Android Error: 09-15 18:26:47.434 3096-3096/com.example.user.navigationdrawer E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.user.navigationdrawer, PID: 3096 java.lang.IllegalArgumentException: new x-value must be greater then the last value. x-values has to be ordered in ASC. at com.jjoe64.graphview.series.BaseSeries.appendData(BaseSeries.java:388) at com.example.user

Unexpected behavior of same methods in different threads

走远了吗. 提交于 2019-12-25 16:55:08
问题 My initial question was: Android GraphView project get freeze with real time updates. In this one I was asking about possible concurrency in UI thread of 3 plots. On memory allocation plot it looks like this: I was receiving data directly from my ProcessThread in main activity and pass it using onEventMainThread from EventBus library back to the GraphFragment . All the data that is passed comes from ProcessThread which gathers data from Bluetooth listening service and then proceeds it to get