mpandroidchart

line graph like google weather graph

╄→尐↘猪︶ㄣ 提交于 2019-12-11 05:25:55
问题 I have UI requirement with ling graph, the graph will be have icons above xaxis just like google weather app UI. Following image is reference. Like above image wee need to display icons for the graph.I have previously used MPAndroidChart. I have tried different concepts available in google and SO. still unable achieve this UI. I have followed following articles To show icons in bar chart When any value click showing icon If anyone knows how to implement this UI, help me out. 来源: https:/

How to add String labels to both x and y axis in MPAndroidChart

回眸只為那壹抹淺笑 提交于 2019-12-11 04:18:37
问题 I am trying to add a String Label in order to label both the domain (x-axis) and the range (y-axis) of my LineChart , as shown in the picture below. Any suggestions on how to do it using MPAndroidChart? 回答1: (Turning @Ironman's comment into an answer:) As of MPAndroidChart 3.0.1 this is currently not possible using the API exposed by the library. You will need to add additional TextView outside the chart, or modify the library to your purpose. If you want to modify the library to your own

Grouping datasets in MPAndroid charts

蹲街弑〆低调 提交于 2019-12-11 04:14:04
问题 I have two datasets. I want to make a chart with mpandroidchart . This is my dataset in json format : const bar_chart_point_ver = { "datasets": [{ "name": "set1", "setColor": ["#004D40", "#004D40", "#004D40", "#004D40", "#e74c3c", "#f1c40f", "#3498db" ], "points": [{ "x": "eli", "y": "24" }, { "x": "mah", "y": "38" }, { "x": "sa", "y": "77" }, { "x": "ni", "y": "17" } ] }, { "name": "set2", "setColor": ["#3498db"], "points": [{ "x": "eli", "y": "12" }, { "x": "mah", "y": "24" }, { "x": "sa",

How to use icons as the labels of piechart in MPandroidchart library

ⅰ亾dé卋堺 提交于 2019-12-11 03:42:08
问题 I am using mpandroidchart library to build a pie chart. The requirement for pie chart is that it should contain icons in each entry. In my case it is showing up the percentage of each entry values. Is there any way to change the labels to icons? My Fragment class public class MonitorOverallFragment extends Fragment { private int[] CHART_COLORS = {Color.rgb(253,151,39), Color.rgb(103,63,180), Color.rgb(204,217,72), Color.rgb(44,152,240)}; private Context mContext; private Activity mActivity;

Android MPchart Piechart Legend setCustom error

怎甘沉沦 提交于 2019-12-11 03:23:56
问题 I am using MPchart piechart. When i set custom legend arrays it not accepting that array. My code... Legend l = chart.getLegend(); l.setCustom(ColorTemplate.VORDIPLOM_COLORS, new String[] { "aaaaa", "bbbbb", "ccccc"}); Error... Cannot resolve method 'setCustom(int[],java.lang.String[])' My MPchart version : v3.0.0 How can i resolve this issue.? 回答1: This worked for me to set a custom legend: // Use Legend Entry LegendEntry l1=new LegendEntry("Bank", Legend.LegendForm.DEFAULT,10f,2f,null,

MPAndroidChart: Combined Chart

那年仲夏 提交于 2019-12-11 02:59:46
问题 I am using MPAndroidChart library. I wanted to use the CombinedChart to create a Chart like that: Is that possible? I tried it out but it doesnt seem to work because the entries arent working as i expected. You cant say an entry has value 2 on the x-axis and value 300 on the y-axis. Also i cant create two different y-axis, one for the bars and one for the lines. Some curious thing is that MPAndroidChart first adds all x-values and after that all y-values and you have no possibility to

setDescriptionTextSize(float size) cannot resolve method MPAndroidChart

梦想的初衷 提交于 2019-12-10 23:37:44
问题 I am making a PieChart in android studio but am running into some issues with styling. The size of description (and legend and values are really small). I read the docs about this and it said there i had to use the setDescriptionTextSize() method and that it is available for every chart type. However that method is not resolved for some reason. extra info about project: -the problem occurs in a fragment -my pieChart is built in the "onChildAdded" method because it needs to be created when

Make line chart with values and dates

青春壹個敷衍的年華 提交于 2019-12-10 22:19:37
问题 In my app i use ios-charts library (swift alternative of MPAndroidChart). All i need is to display line chart with dates and values. Right now i use this function to display chart func setChart(dataPoints: [String], values: [Double]) { var dataEntries: [ChartDataEntry] = [] for i in 0..<dataPoints.count { let dataEntry = ChartDataEntry(value: values[i], xIndex: i) dataEntries.append(dataEntry) } let lineChartDataSet = LineChartDataSet(yVals: dataEntries, label: "Items count") let

In MPAndroidChart, how to add the click event for the each Bar in Barchart?

陌路散爱 提交于 2019-12-10 17:15:46
问题 Am using MPAndroidChart library to implemented the Barchart , How to implement the click listener for each bar in Barchart .I want to show the clicked bar value in Toast.How to implement this one ? mChart = (BarChart) findViewById(R.id.chart1); mChart.setDrawYValues(true); mChart.setDrawValueAboveBar(true); mChart.setDescription(""); mChart.setMaxVisibleValueCount(10); mChart.set3DEnabled(false); mChart.setPinchZoom(false); mChart.setUnit(" mg/dL"); mChart.setDrawGridBackground(false); mChart

How to set description in MPAndroidChart?

若如初见. 提交于 2019-12-10 17:09:46
问题 I'm a new MPAndroidChart user. The examples I have found on-line and the Wiki here all give the setDescription() prototype as: setDescription(String desc)` However, mChart.setDescription(""); does not compile for me and AndroidStudio->Go To Declaration tells me the declaration for setDescription defined in Chart.java is : public void setDescription(Description desc) { this.mDescription = desc; } And the Description constructor in Description.java does not take a String. How do I set the