mpandroidchart

MPAndroidChart: Hide 0 value labels in a stacked bar chart [closed]

点点圈 提交于 2019-12-06 02:06:18
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 4 years ago . I am using MPAndroidChart to show a stacked bar chart containing two sets of data (Income and Expenditure). I'm having an issue when the value is 0 the label overlap other x axis values. In the case of the screenshot you can see that the bars which have values have overlapping values for the

MPAndroidChart is there a way to set different colors for different bars?

扶醉桌前 提交于 2019-12-05 21:01:14
I am using MPAndroidChart in my app and i was wondering if there is a way to set a diferent color for the first bar in a dynamically moving bar chart, like this: The bars are added dynamically while the whole stack is being moved to the left as the data keeps coming, is there a way to set the color of the first bar to be a different color? thank you in advance. EDIT and Solution: here is my code for adding a new entry to the chart, it occurs dynamically every 500 millis or so. private void addBarEntry(float value) { BarData data = mDownloadChart.getData(); if(data != null) { BarDataSet set =

MPAndroidChart: XAxis values not corresponding to Data values

懵懂的女人 提交于 2019-12-05 20:04:33
I've a problem using MPAndroidChart: I have some entry data to display in a Bar Chart, but the xaxis labels aren't displaying on the position I want: I want to show them one per chart value, immediatly under the "bar". This is what is happening right now: And this is my code: ArrayList<BarEntry> entries1 = my entries...; final ArrayList<String> stringList1 = my strings...; XAxis xAxis1 = chartCost.getXAxis(); xAxis1.setPosition(XAxis.XAxisPosition.BOTTOM); xAxis1.setDrawGridLines(false); xAxis1.setCenterAxisLabels(true); /* xAxis1.setValueFormatter(new IAxisValueFormatter() { @Override public

MPAndroidChart Bar Chart - how to group bars with random x-axis intervals in between groups?

我怕爱的太早我们不能终老 提交于 2019-12-05 19:40:51
I want to make a bar chart with 3 different datasets grouped together at each data point like so: However, I am unable to group the bars together using the library's provided groupBars method because no matter what x-value I set for an entry, it groups the bars according to the interval I specify in its parameters. For example, if I generate a dataset with entry x-values {0, 5, 13, 17...50} and call `groupBars', all of my entries are gathered 1 x-value apart like so: What I want is the bars to each be grouped and each be visible at their specified x-value. If I simply remove the groupBars call

MPAndroidChart BarChart horizontal / vertical

跟風遠走 提交于 2019-12-05 19:26:59
问题 I am using the MPAndroidChart library. In BarChart by-default all the bars are vertical (bottom-up), how to display it in horizontally? 回答1: There are two types of bar-charts in terms of orientation. The normal/vertical bar-chart (bars go bottom-up), class BarChart , looks e.g. like this: The horizontal bar-chart (bars go left-right), class HorizontalBarChart , looks like this: In addition to that, there are also so called stacked-bars (multiple values in a single bar), which can be used in

How to plot data from right to left in MPAndroidChart?

依然范特西╮ 提交于 2019-12-05 13:53:10
I recently update the MPAndroidChart library from 1.7.4 to 2.0.9 and I forgot what I did to customize the linechart to make the data displaying from right to left. Does anyone know? I am wondering if there is a method to call to do that. There is no method. But it can still be done because it only depends on how you add the data. Just add values at higher x-indices first. Say you got a chart with x-axis labels from January to December with an x-axis range from 0 - 11 (12 values). Now add the december value at index 11, and so on. One Zero If you want to set the first data point other than zero

Adding Axis Titles to mpandroidchart

我怕爱的太早我们不能终老 提交于 2019-12-05 08:38:15
I am trying to add axis titles to the bar chart created using mpandroid chart library. I am using more than one fragments in my activity and the bar chart is a fragment. I am adding data dynamically and everything is working fine. I want to add titles to x and y axis and when I searched I found that it is not supported by the library. They suggest we add the textview in chart or edit the library. I know this issue is same as this post but they don't have the answer. How to add String Label to MPAndroidCharts I tried adding a textview to view and it got added to the top of the graph. I tried

MPAndroidChart PieChart how to change the center text to display the different color and font size

不问归期 提交于 2019-12-04 20:28:51
Currently I use the MPAndroidChart from GITHUB and draw the piechart to display the two line text, each line has different color and different font size,I check the source codes and the center text is a string object, and try to use: PAINT paint = pie_chart.getPaint(Chart.PAINT_CENTER_TEXT); but looks like not work, would someone has the experience to do it and guide me about it. after study the source codes, i change the PieChartRenderer.java to change the mCenterTextPaint.setColor(Color.parseColor("#333333")); mCenterTextPaint.setTextSize(Utils.convertDpToPixel(20f)); mCenterTextPaint

Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease' while generating APK

半城伤御伤魂 提交于 2019-12-04 19:06:53
I have generated an APK of my Android application (as a try) and I did not have any problem, the APK has been generated correctly. Now, I want to obfuscate my code while generating the APK so I used the following line on my release block on build.gradle file. minifyEnabled true The problem is that now it throws me the following error: Error:Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'. java.io.IOException: Please correct the above warnings first. with a lot of warnings. To be more exact, 1018 warnings. Most of them are like: Warning:com.itextpdf.text.pdf

How to not draw zero values on a linechart while showing their X axis values on MPAndroidChart?

纵然是瞬间 提交于 2019-12-04 14:13:08
问题 I'm using MPAndroidChart to display my data in a line graph. For each date I have its own value. This works just fine. What I want to do now is to not draw the 0 values, but instead draw the line between 2 adjacent non-zero values (like a trend-line), while keep showing the dates on the x-axis for the zero values. My current graph: The desired graph should look similar to this graph: How can I achieve this behavior? 回答1: I'm posting my friend's solution here (worked like a charm): Create a