mpandroidchart

How to continuously update Y-axis values in MPAndroidChart

半世苍凉 提交于 2021-01-22 08:36:08
问题 I want my axis in LineChart to adjust it's maximum and minimum values real-time. Functions like resetAxisMaxValue() and resetAxisMinValue() work well when new data's Y-value is increasing(both positive and negative), however, once the signal gets low again Y-value max and min never drops to the smaller values so it can show all new data on the full canvas of the graph. I wanted to check whether there is method to do so automatically, or whether I should use brute force. Thank you. 回答1: Alex's

Customize the marker - MPAndroidChart

亡梦爱人 提交于 2021-01-21 07:39:49
问题 I've created a Simple Bar Chart using MPAndroidChart . For the purpose of Marker I'm extending MarkerView . I need a marker as shown in the git hub, like this: But I'm not getting that arrow. So it is not looking like a comment, it's a rectangular box :/ In order to make it look like a comment box instead of a rectangular box which class I should use. I've checked IMarker , MarkerImage but not sure which I should proceed with. And even MPPointF isn't working. Can't import the package import

How to change line and fill color of MPAndroidChart line chart based on if y axis value is positive or negative

泄露秘密 提交于 2020-12-13 03:08:25
问题 Was wondering if it is possible to change the line and fill color for the line chart based on if the y-axis values are positive or negative. An example of it is below Below is what i could achieve with the following code private fun setUpLineChart() { val lineData = getDataSet() view.lineChart.apply { data = lineData description.isEnabled = false setScaleEnabled(false) setTouchEnabled(false) legend.isEnabled = false axisLeft.apply { setDrawLabels(false) setDrawGridLines(false) setDrawAxisLine

Android-MPAndroidChart:RadarChart(雷达蜘蛛图)绘制圆点

无人久伴 提交于 2020-08-20 07:51:08
目录 思路 实现 思路来源于 Homilier ,感谢博主! 效果是这样子的: 思路 从RadarChart类中我们可以看到 init() 方法中的内容,可以看出来自定义了绘制类。仅从字面我们就可以看出 RadarChartRenderer 是绘制雷达的,YAxisRendererRadarChart和XAxisRendererRadarChart是绘制x轴/y轴相关内容的,既然这样那我们就清楚了,进 RadarChartRenderer 看看里面的实现; 从方法名上就可以看出端倪, drawValues(Canvas c) 是咱重点关注的内容。所以在这开造。 实现 直接贴代码,很基础的绘制代码,就不做介绍了。代码过长,没必要的就直接用省略号了,对比下RadarChartRenderer即可 public class RadarChartRenderer extends LineRadarRenderer { protected RadarChart mChart; /** * paint for drawing the web */ protected Paint mWebPaint; protected Paint mHighlightCirclePaint; public RadarChartRenderer(RadarChart chart, ChartAnimator

HorizontalBarChart moveViewToX doesn't work

会有一股神秘感。 提交于 2020-08-11 06:18:26
问题 Summary When using BarChart everything work as expected, but moveViewToX doesn't work on HorizontalBarChart. I've tested with the same code, only changing the XML, and the error is only affecting HorizontalBarChart I've searched opened issues (most relevant was #2546 which is closed and the proposed solution didn't worked in my case) and searched on StackOverflow but I haven't found a solution yet. Device: Device: Xiaomi Redmi Note 4 Android Version 6.0 Library Version 3.1.0-alpha Here is the

MPAndroidChart Bar Chart Values

柔情痞子 提交于 2020-08-08 05:40:09
问题 I've been reading through the documentation for MPAndroidChart (using v3.0.1) and I can't seem to find a way to remove the labels on the bars I would like to hide the values that are shown on top of each bar, OR change the values of them to something I can set manually. Either option would work well for my implementation. I'm not sure if it is even possible to do either. I'm very new to android development any help would be great. my code is: public class MainActivity extends

DateTime axis in MPAndroidChart

北城余情 提交于 2020-06-11 06:37:46
问题 I am using MPAndroidChart in my app. I want to plot the chart using values on yAxis and dates on the xAxis. I didn't find any datetime axis in the MPAndroidChart API. Is there any way to plot the xAxis using date? I have values to plot against dates. I want to show the dates in (ddMMM-yy) format on xAxis and the values on yAxis. Can anyone can pass me the sample link for the same? Sample data: Date(xAxis) | Value(yAxis) ------------|------------- 01/01/2001 | 966.78 01/02/2001 | 666.78 01/03

Dynamically set x-axis labels are not displaying in android

陌路散爱 提交于 2020-05-24 05:47:13
问题 Hi in the below code I was implemented barchart using library called Mpandroidchart.Dyanmically I am setting the Labels for x-axis.But lables are not displaying for the x-axis. Below is my code task types are the list of the string that strings are I am trying to set labels for X-axis. chart1 = rootView.findViewById(R.id.chart11); xl.setValueFormatter(new IndexAxisValueFormatter(getTaskCount())); public ArrayList<String> getTaskCount() { ArrayList<String> label = new ArrayList<>(); for (int i

Dynamically set x-axis labels are not displaying in android

时间秒杀一切 提交于 2020-05-24 05:47:10
问题 Hi in the below code I was implemented barchart using library called Mpandroidchart.Dyanmically I am setting the Labels for x-axis.But lables are not displaying for the x-axis. Below is my code task types are the list of the string that strings are I am trying to set labels for X-axis. chart1 = rootView.findViewById(R.id.chart11); xl.setValueFormatter(new IndexAxisValueFormatter(getTaskCount())); public ArrayList<String> getTaskCount() { ArrayList<String> label = new ArrayList<>(); for (int i