mpandroidchart

MPAndroidChart LineChart custom highlight drawable

混江龙づ霸主 提交于 2019-11-28 11:02:58
I'm using MPAndroid Chart library to draw Line Chart in my Android app. The status of graph is like: I want to change it like this: So I want to change MPAnroid Line Chart's points, ts called "Circle Hole" in library. I want to switch this hole to drawable. There is a way I can do that? The circle hole change code is here: LineDataSet set1 = new LineDataSet(yVals, "DataSet 1"); set1.setDrawCircleHole( true ); set1.setCircleColor( Color.BLACK ); Library reference is here: MPAndroidChart Since version 3.0 you can provide your own custom image that will be displayed on selecting a given point on

(MPAndroidChart-LineChart) I didn't get the last label in my app

时光毁灭记忆、已成空白 提交于 2019-11-28 09:41:56
问题 I use MPAndroidChart v3.0.2 now. The problem is that lasst data('05일') is not showing... This is the value while I get on Debug xVals : 1일, 2일, 5일 and It is the source and the result screenshot. I think the '5일' enter the 'red circle'... but I don't know the reason.. LineChart chart = (LineChart) findViewById(R.id.chart); if (ExRegList.length() == 0) { chart.clear(); chart.setDescription(null); chart.setNoDataText("데이터가 존재하지 않습니다."); // There is no data. chart.invalidate(); } else { ArrayList

How to format values inside MPAndroidChart?

混江龙づ霸主 提交于 2019-11-28 09:01:55
2 Questions about the MPAndroidChart library . All my yvalues are integers, but displayed as Decimals. How can I get them displayed as integers (without the digits)? How can I prevent that the ylabels are also shows as decimals? I know there is a setFormatter for the yvalues, just don't understand how to use... Have a look at the IValueFormatter interface provided by the library. With that interface, you can completely customize what gets displayed on the chart based on your own logic. Usage: chart.setValueFormatter(new YourValueFormatter()); YLabels yl = chart.getYLabels(); yl.setFormatter

Plot Multiple Charts in one in MPAndroidChart

折月煮酒 提交于 2019-11-28 08:17:37
问题 I have to plot two different dataSets in a single graph. DataSet-1 String[] xAxisOne = new String[] { "0", "1", "2", "3", "4", "5", "6" }; float[] dataInput = { 1f, 2f, 3f, 4f, 5f, 6f, 7f }; DataSet-2 String[] xAxisTwo = new String[] { "0", "2", "4", "5", "6", "8", "9" }; float[] dataIn = { 3f, 4f, 5f, 6f, 7f, 8f, 9f }; In the above data, DataSet-1 is reference by which graph is created. DataSet-2 has to be plotted in the same with different set of X-Values {xAxisTwo} . In existing

MPAndroidChart v3.x.x: upgraded from 2.x.x labels

萝らか妹 提交于 2019-11-28 04:51:18
问题 As mentioned in the title, I am working on a project where MPAndroidChart version 2.2.3 is used. In this project, Bar chart is currently used. I am doing the version upgraded to 3.0.1. After the upgrade, few things below does not work anymore: 1. mBarChart.setDescription(""); 2. xAxis.setSpaceBetweenLabels(1); 3. BarData barData = new BarData(ArrayList<String>, ArrayList<IBarDataSet>); I looked around but seems like there is no explanation for those issue, even in the release note. 回答1: First

Is it possible to create a multiple color (stacked) bar chart using MPAndroidChart?

♀尐吖头ヾ 提交于 2019-11-28 01:53:26
问题 I have below data to represent in chart format using MPAndroidChart library: Subject Marks Needs Attention Average Outstanding Hindi 1/5 2/5 2/5 English 2/7 3/7 2/7 Maths 1/3 1/3 1/3 Science 2/7 2/7 3/7 Physics 2/9 4/9 4/9 Sanskrit 3/7 3/5 0 And I want a chart like below: The above chart is only sample, I want three colours in each bar (stacked). I have already made a bar chart with separate colors, but can't make such multiple coloured chart. Is it possible in MPAndroidChart? 回答1: This is

MPAndroidChart: add custom image inside bars

て烟熏妆下的殇ゞ 提交于 2019-11-27 23:07:09
I am using MPAndroidChart and I want to show a custom drawable inside this CombinedChart like in below image: If bar value is >= a goal value, say, 50, then I would like to add a star image inside the bar. Can any one help me for customise the BarChart? To get the star image inside our bars, we will need to create a custom renderer. Because our bar chart uses BarChartRenderer we will subclass this first and add a parameter for our image: public class ImageBarChartRenderer extends BarChartRenderer { private final Bitmap barImage; public ImageBarChartRenderer(BarDataProvider chart, ChartAnimator

MPAndroidChart x-axis date/time label formatting

浪子不回头ぞ 提交于 2019-11-27 22:23:08
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 full hour (##:00) (not perse all) in case of a day span; on any 5 minute point on an hour span. Problem

In MPAndroidChart Library, How to wrap X Axis Labels to two lines when long?

坚强是说给别人听的谎言 提交于 2019-11-27 20:42:17
I am trying to show X axis label to go to 2 lines when they are long. How to achieve this in LineChart? See screenshot below. I want time to go to second line instead of staying next to date For those like me who want to achieve this but keep the original library, here is a simple solution inspired by @fgueli's modifications. This applies for one break line only (add "\n" in your labels) but you can easily adapt it to your needs. Subclass XAxisRenderer public class CustomXAxisRenderer extends XAxisRenderer { public CustomXAxisRenderer(ViewPortHandler viewPortHandler, XAxis xAxis, Transformer

Android charting libraries [closed]

拟墨画扇 提交于 2019-11-27 16:56:49
I am trying to find a fast and reliable charting library. After some searching, I found 4 libraries: AChartEngine , WilliamChart , HelloCharts and AndroidPlot . I need some up to date feedback about the performance and the stability of these libraries because all the information I could find was outdated. You can use MPAndroidChart . It's native, free, easy to use, fast and reliable. Core features , benefits: LineChart, BarChart (vertical, horizontal, stacked, grouped), PieChart, ScatterChart, CandleStickChart (for financial data), RadarChart (spider web chart), BubbleChart Combined Charts (e