mpandroidchart

Custom view of Limit Line in MPAndroidChart

回眸只為那壹抹淺笑 提交于 2019-12-17 16:29:16
问题 Is it possible to replace LimitLine with custom layout? So it looks something like this: I see few solutions for that: Perhaps there're methods inside library for customizations like this, are there any? Get coordinates of TextView where the value is stored and add custom layout on that place. But how can I reach this TextView ? Perhaps someone faced that problem. Please share your experience. EDIT: latest partial solution After long searching of solution I came up to adding custom view

MPAndroidChart x-axis date/time label formatting

陌路散爱 提交于 2019-12-17 16:17:37
问题 Background For some charts in my app, I'm using the MPAndroidChart library. All horizontal axis' of my graphs are time based, they can span a full year, a month, a week, a day or span one hour. It always shows a full period, so January-December, Monday-Sunday, 0:00 - 24:00 etc. The value of the axis is always the epoch-timestamp (in seconds). Requirement I want the x-axis labels to follow these rules: at 1st of month in case of year span; at start of day in case of month or week span; on any

How do MPAndroidChart renderers work and how do I write a custom renderer?

核能气质少年 提交于 2019-12-17 03:19:10
问题 I am using the library MPAndroidChart but it doesn't have all of the functionality I want out of the box. I have heard that it is possible to implement the functionality I want by writing a custom renderer. I have looked at the source code for the renderers in the MPAndroidChart GitHub repo, but I can't understand the concepts involved. How do MPAndroidChart renderers work? What is the high-level procedure for writing a custom renderer? Note: for many questions posted on SO for mpandroidchart

Show image instead of text in MPAndroidChart pie chart

为君一笑 提交于 2019-12-14 04:01:00
问题 I have a pie chart in my android application that i draw with MPAndroidChart. <com.github.mikephil.charting.charts.PieChart android:id="@+id/chart" android:layout_width="400dp" android:layout_height="400dp" android:layout_centerInParent="true" /> PieDataSet pieDataSet = new PieDataSet(entries, "expenses"); pieDataSet.setColors(ColorTemplate.PASTEL_COLORS); pieDataSet.setDrawValues(false); PieData data = new PieData(xValues, pieDataSet); chart.setData(data); chart.getLegend().setEnabled(false)

MPAndroidChart - CombinedChart - First and last bars aren't visible completely

谁说我不能喝 提交于 2019-12-13 23:46:10
问题 In CombinedChart by adding chart.setFitBars(true) will make the first and last bars visible. I need to do the same for combining LineChart with BarChart. Now, first and last bars aren't visible completely. I've tried xAxis.setAxisMaximum(data.getXMax() + 1f); to extend X-Axis towards right side so that the last bar will get enough space. This did the trick. But what should I do for left side bar? setAxisMinimum doesn't help. After adding setAxisMaximum : EDIT I've referred this but it gives

How to set String value of xAxis in MPAndroidChart?

╄→尐↘猪︶ㄣ 提交于 2019-12-13 13:22:50
问题 I want to make Line Chart Graph, but i have problem to show value string in xAxis, im used Library Github from MPAndroidChart to LineChart. Please help me how to add String Value and actually to much question i want ask private void drawLineChartLine(){ private float[] yDataL = {40, 60, 70, 80}; private String[] xDataL = {"Week 1", "Week 1" , "Week 3" , "Week 4"}; ArrayList<Entry> yEntrys = new ArrayList<>(); final ArrayList<String> xEntrys = new ArrayList<>(); for(int i = 0; i < yDataL

How to get label for corresponding swipe in barchart of mpandroidchart?

馋奶兔 提交于 2019-12-13 08:28:27
问题 How to get label for corresponding bar when I swipe the barchart? I have another textview outside of barchart. When I swipe mpandroidchart graph, I need to get x axis label of corresponding position and display in textview. How to do that? I tried with this. barChart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() { @Override public void onValueSelected(Entry e, int dataSetIndex, Highlight h) { Log.i("Entry", String.valueOf(e)); } @Override public void onNothingSelected() {

How to implement multiple highlight line sliders in line chart

左心房为你撑大大i 提交于 2019-12-13 04:39:39
问题 I want to implement single and multiple highlight line sliders in line chart. I am able to get only single highlight line slider with MPAndroidChart (https://github.com/PhilJay/MPAndroidChart) library. But I also need two highlight line sliders to allow the user to select range of values(min and max values) on the chart. Please refer the below image for more information: Can we achieve the above requirement with any library or we need to draw a custom view? Any help or guidance will be well

Creating a line slider on a graph in android

*爱你&永不变心* 提交于 2019-12-13 01:45:05
问题 I have created a graph with a series of data. Now I'm trying to add a slider / line marker to the chart like the one below. I created the graph/charts using the MPAndroidChart library provided here https://github.com/PhilJay/MPAndroidChart. The graph seems to be working fine and good but i need a line slider like below so that when i touch on the graph the line slides and provides the values of the line intersecting the graph. Could anyone help me figure out this problem or do i have to use a

MPAndroidChart Logarithmic Y Axis

会有一股神秘感。 提交于 2019-12-12 21:21:51
问题 I need to implement a line chart inside my application and I would like to make use of MPAndroidChart. The problem is that the value on the y axis will be somewhere between 1 and 1x10^-12. Thats why i need an Logarithmic view on that axis. Is there any way to achieve this with that libary? (or maybe other chart libary?) Thanks for your help. 回答1: This chart library uses Matrix -multiplication for value to pixel transformation. Those are linear-transformations, which means they cannot stretch