mpandroidchart

width and height must be > 0 error when using MPAndroidChart library

家住魔仙堡 提交于 2019-12-24 12:33:42
问题 I wanted to use MPAndroidChartLibrary in my application, but I am experiencing problems which I can't solve on my own. I would like to put the chart into the CardView which is stored inside ListView. CardView's xml looks like this: <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" > <android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto" xmlns:android="http:/

Plotting android recording samples's amplitude on moving graph RealTime

穿精又带淫゛_ 提交于 2019-12-24 08:57:41
问题 I'm developing a recording app, for which I am trying plot amplitude of audio recording samples against time on Android View similar to below image. The graph should move with time towards the left side of the screen. I tried using LineChart of MPChart Library but still, the result is not as expected. MPChart homepage has a screenshot of such graph, but couldn't figure it how to implement. Please help. Thank you. 回答1: You can use LineChart for that, here is official RealtimeLineChartActivity

How to get selected bar x-axis name(Strings added to x-axis) using MP Chart?

一世执手 提交于 2019-12-24 08:23:12
问题 I know this is a duplicate to the link question I have followed the same but I am getting the following error : @Override public void onValueSelected(Entry e, Highlight h) { String xAxisValue = mChart.getData().getXVals().get(e.getXIndex()); } ERROR : cannot resolve getXVals() and cannot resolve getXIndex() Please help : I have the following x-axis values : India, Australia,US,China On click of a Bar in barchart I need to get One of the above string 回答1: In MPAndroidChart 3.0.0+ this should

MpAndroidChart CombinedChart - How to prevent LineData circles being drawn over Bubble data?

自古美人都是妖i 提交于 2019-12-24 07:59:07
问题 I have been playing with the official CombinedChartActivity example to show 2 line charts, 1 bar chart and some bubble data. Despite having changed the DrawOrder ... mChart.setDrawOrder(new DrawOrder[]{ DrawOrder.BAR, DrawOrder.CANDLE, DrawOrder.LINE, DrawOrder.SCATTER, DrawOrder.BUBBLE }); ...my Bubbles are still getting drawn over by the line circles. As you can see in this screenshot, the lines are correctly appearing behind the bubbles; It's just the line circles that are appearing in

MpAndroidChart - How to fill area between two lines on a CombinedChart?

这一生的挚爱 提交于 2019-12-24 06:47:38
问题 This answer to a similar question shows how to fill the area between two lines on an MpAndroidChart LineChart . However, rather than using LineChart, I am using CombinedChart (as I also have bar data to show). But applying the above solution to a CombinedChart results in this exception: java.lang.ClassCastException: org.example.MyLineLegendRenderer cannot be cast to com.github.mikephil.charting.renderer.CombinedChartRenderer at com.github.mikephil.charting.charts.CombinedChart.setData

App Refuses to Install - INSTALL_FAILED_MISSING_SHARED_LIBRARY

谁都会走 提交于 2019-12-24 04:25:23
问题 I am new to programming generally please I need some help! My app was installing successfully after every update until i decided to add the 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha' library to the app because i need the user to be able to view some data in form of statistical charts. The library was synced successfully and have used packages and classes therein successful. But when i try to install the app in my android device it returned this error: Installation failed with message

IndexAxisValueFormatter not working as expected

十年热恋 提交于 2019-12-24 02:45:16
问题 I'm using the MPAndroidChart to create a bar chart. My configurations: <string-array name="months_initials"> <item>J</item> <item>F</item> <item>M</item> <item>A</item> <item>M</item> <item>J</item> <item>J</item> <item>A</item> <item>S</item> <item>O</item> <item>N</item> <item>D</item> </string-array> ... String[] months = getResources().getStringArray(R.array.months_initials); chart.getXAxis().setCenterAxisLabels(true); chart.getXAxis().setLabelCount(months.length, true); chart.getXAxis()

How can I alter the spacing for the Y-Axis Labels in MPAndroidchart?

为君一笑 提交于 2019-12-23 22:25:21
问题 How can I make my YAxis labels elevated with a gap i.e., start from a given value like the below picture? If I try using offset it makes my YAxis label values plot incorrectly against the Y-Axis data. Here is my code so far: public void setChartProperties() { YAxis rightAxis = chart.getAxisRight(); YAxis leftAxis = chart.getAxisLeft(); XAxis xAxis = chart.getXAxis(); chart.getLegend().setEnabled(false); chart.getDescription().setEnabled(false); chart.setDrawBorders(false); chart.setPinchZoom

How to enable cubic lines in MPAndroidChart library?

て烟熏妆下的殇ゞ 提交于 2019-12-23 08:19:29
问题 I am using MPAndroidChart library for a project of mine to integrate charts in my app. I know how to use LineCharts but I couldn't figure out a way to use the Cubic Lines feature of the LineCharts. The image below shows the kind of graph i want, please let me know how to solve this issue. 回答1: Try using something like this lineDataSet.setDrawCubic(true); It worked for me, here lineDataSet is your LineDataSet instance. Update for v3.0.0 and onwards: lineDataSet.setMode(LineDataSet.Mode.CUBIC

MPAndroidChart, how to remove decimal percentages and not show percentages below 10?

对着背影说爱祢 提交于 2019-12-23 08:01:30
问题 I am using MPAndroidChart and I have two questions: MPAndroid Pie Chart Remove decimal percentages Not show values on the Pie Chart that have values less than 10%, but show the slice; just the text should not be shown for the percentages less than 10%. 回答1: Update for version 3.0.0+ Formatting values is now done by extending the ValueFormatter class and overriding the required methods for formatting. This is also where custom logic (e.g. only show labels for values > 10) can be inserted.