mpandroidchart

Android MPChart issue with X and Y axis printing

元气小坏坏 提交于 2019-12-08 07:53:34
问题 I am using MPChart for drawing line graph. Below is the code I used to draw the chart. The graph works fine. The only problem I have is I need to have the x and y axis printed (i.e) L shape on the left and bottom of the graph. I want the X values (thats passed to LineData) to be printed at the bottom of the graph (x-axis) and I want to set minimum and maximum value for the y-axis and the graph should be adjusted based on this min and max value. If I uncomment Line 1 part and pass true /

Swift chart library. How to display X axis dates in a right places

安稳与你 提交于 2019-12-08 07:26:30
问题 EDITED: This is a debug video as well. I use this library to show charts in my Swift iOS app. This is my chart: X axis is for dates and Y axis is for lifted weight for my athletes. The ocean blue dots in the middle of the charts that you see it is an intersection between a date and lifted weight. But I am not sure how a chart shows two the same dates and a dot at the middle of dates. My question is how can I set up X axis to shift Aug 23 to the middle of the screen as well or to fit a dot I

MPAndroidChart multiple tooltip/marker view for linechart with 3 data sets

拟墨画扇 提交于 2019-12-07 10:29:53
问题 I am currently using MPAndroidChart for my application. In one scenario, I show three datasets within one linechart and when I click on the line on the graph, I get to show only one Tooltip at a time. Instead based on the cross hair position, I would like to show individual tooltip for all three datasets. I have gone through many other questions here and I couldn't find exactly what I am looking for. This is a sample screenshot of my required output. I would like to know if this is possible

MP android chart displaying float values at X-Axis of Horizontal bar Chart?

荒凉一梦 提交于 2019-12-07 07:49:37
问题 I am using MP chart for displaying reviews, everything is working fine except that the the X-axis values are displaying as a floating value (for number of particular type of review). This is the code I am using: BarData data = new BarData(getXAxisValues(), getDataSet(properties)); chart.setData(data); chart.getXAxis().setEnabled(false); // hides horizontal grid lines inside chart YAxis leftAxis = chart.getAxisLeft(); chart.getAxisRight().setEnabled(false); // hides horizontal grid lines with

MPAndroidChart hide background grid

自古美人都是妖i 提交于 2019-12-06 16:35:07
问题 I'm using MPAndroidChart - LineChart in my android application. I want to remove gridlines from the background . How can I remove gridlines from the background? Library: MPAndroidChart on GitHub EDIT: I created my own custom LineChart using this library. I want to remove bottom line. how can I do that too? 回答1: Use this: mChart.getAxisLeft().setDrawGridLines(false); mChart.getXAxis().setDrawGridLines(false); Please note you may need right axis or both of them. It depends on axis you are

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

怎甘沉沦 提交于 2019-12-06 14:09:41
问题 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

how to set values for xlabels and ylabels in mpandroidchart

我的未来我决定 提交于 2019-12-06 14:05:42
I am using mpandroidchart android library. I am implementing line charts. Here can i set the x and y labels on my own? currently it is adding the values based on the dataset provided to the chart. Can you please give some idea on this? You have to use a formatter on your axis object. There is two kind of formatter XAxisValueFormatter and YAxisValueFormatter. This the code i used to change the X label number with suffix "h" for hours : //get reference on chart line view LineChart chart = (LineChart) pActivity.findViewById(R.id.chart); //set formater for x Label chart.getXAxis()

MPAndroidChart: Chart Not Displaying

放肆的年华 提交于 2019-12-06 11:37:57
I added a BarChart into my project XML (snippet of layout below): <RelativeLayout android:id="@+id/relative_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" > <com.github.mikephil.charting.charts.BarChart android:id="@+id/chart" android:layout_width="match_parent" android:layout_height="match_parent" /> <TextView android:id="@+id/stepsTitle

How to get selected label for Entry inside onValueSelected() in MPAndroidChart?

為{幸葍}努か 提交于 2019-12-06 11:24:27
问题 I have written the following OnChartValueSelectedListener for my pie chart. I am able to get the value with the code below. However, I would like to get the text label as well. In the code below, e.getY() will get the y-value. How do I get the text label for the Entry ? holder.chartyear.setOnChartValueSelectedListener(new OnChartValueSelectedListener() { @Override public void onValueSelected(Entry e, Highlight h) { Log.e("VAL SELECTED", "Value: " + e.getY() + ", index: " + h.getX() + ",

MPAndroidChart: LineChart with cubic bezier displays wrong (spikes and loops)

不想你离开。 提交于 2019-12-06 05:54:11
问题 I am trying to make a LineChart with a cubic plot. The result is like in the screenshot below: the cubic bezier displays wrong and has "spikes". Can someone help me make it appear correctly? This is my config : LineDataSet lineDataSet = new LineDataSet(entries,nameLabel); lineDataSet.setColor(Constants.colors.get(i)); lineDataSet.setDrawValues(false); lineDataSet.setDrawCircles(false); lineDataSet.setMode(LineDataSet.Mode.CUBIC_BEZIER); Thank you 回答1: Issues like this can have a number of