mpandroidchart

MPAndroidChart - is it possible to control z-index of the chart elements?

隐身守侯 提交于 2019-12-19 09:49:37
问题 I would like to have the following order of drawing in my MPAndroidChart (from bottom to top): Data connecting line Limit line Data points Is it possible? I am aware of the method com.github.mikephil.charting.components.AxisBase#setDrawLimitLinesBehindData . It is working as expected except for one case. When the Y value of all data points is the same, the effect is: or this: I would like it to look like: The first 2 pictures are from MPAndroidChart Android library. The 3rd one is from iOS

MPAndroidChart PieChart how to set label text?

自作多情 提交于 2019-12-19 02:33:53
问题 got the following code: Legend legend = mChart.getLegend(); legend.setLabels(new String[]{"aaaaa", "bbbbb", "ccccc"}); This setting does not take effect Is there an other way to set the text ? 回答1: You can set custom labels with colors: First make sure Legend is enable. Unless enable legend. legend.setEnabled(true); With com.github.PhilJay:MPAndroidChart:v3.0.0:- legend .setCustom(ColorTemplate.VORDIPLOM_COLORS, new String[] { "aaaaa", "bbbbb", "ccccc"}); setCustom(int[] colors, String[]

MPAndroidChart how to set label color?

前提是你 提交于 2019-12-19 02:31:20
问题 got the following code: graph = (LineChart) convertView.findViewById(R.id.graph); graph.getPaint(Chart.PAINT_LEGEND_LABEL).setColor(Color.BLUE); graph.getPaint(Chart.PAINT_YLABEL).setColor(Color.BLUE); graph.getPaint(Chart.PAINT_XLABEL).setColor(Color.BLUE); But still the color of X/Y-value-lables and also the lable of the legend stay in black color. Do I miss something? Is there an other way to set the color of these? This line for example works and results in blue value-lables for each data

java.lang.RuntimeException: Parcelable encountered IOException writing serializable object in Android passing ArrayList object

房东的猫 提交于 2019-12-18 19:30:50
问题 I want to pass my ArrayList object to another activity, using a DataWrapper that implements Serializable . I followed the answer provided here: Pass arraylist of user defined objects to Intent android. I am starting the another Activity from MPAndroidChart library PieChart 's OnChartGestureListener() . This is how I passed my ArrayList object threadList : mChart.setOnChartGestureListener(new OnChartGestureListener() { @Override public void onChartSingleTapped(MotionEvent me) { Intent intent =

MPAndroidChart: Have one graph mirror the zoom/swipes on a sister graph

我与影子孤独终老i 提交于 2019-12-18 13:34:09
问题 I have two line graphs that show complementary data over the same time period. Is there any way to send any touch events received by one graph to the other? I essentially want it so that the graphs always show the same viewing rectangle (at least on horizontally). So if a user swipes left 'n' units on the top graph, the bottom graph will automatically scroll left 'n' units to match. 回答1: Zooms can be done with the current MPAndroidChart release, for scrolling check out or wait for my

MPAndroidChart How to represent multiple dataset object with different number of points in the same chart line

亡梦爱人 提交于 2019-12-18 07:07:57
问题 I am using MPAndroidChart for charting. I am building a line chart which has multiple dataset objects. From the examples provided by MPAndroidChart I can observe that multiple dataset objects can be drawn in the same line chart but with the same number of points (y-values) and those y-values referenced to the same x-values. What happens if I want to draw multiple dataset objects in the same line chart with different number of points (y-values) referenced to different x-values for each one?

MPAndroidChart with null values

旧城冷巷雨未停 提交于 2019-12-18 06:49:16
问题 I'm using the MPAndroidChart and am really enjoying it. A 'little' need I have is that I can put null values to the 'entrys'. I'm monitoring the apache conections on servers of my system, and I would to see if they is down (where I put the null value) or if they just no conections (0). I tried, but the Entry class don't accept 'null' as value showing the message: 'The constructor Entry(null, int) is undefined' Thanks! 回答1: A possible solution for you could be to check weather the object you

MPAndroidChart with null values

孤街浪徒 提交于 2019-12-18 06:49:06
问题 I'm using the MPAndroidChart and am really enjoying it. A 'little' need I have is that I can put null values to the 'entrys'. I'm monitoring the apache conections on servers of my system, and I would to see if they is down (where I put the null value) or if they just no conections (0). I tried, but the Entry class don't accept 'null' as value showing the message: 'The constructor Entry(null, int) is undefined' Thanks! 回答1: A possible solution for you could be to check weather the object you

MPAndroidChart: How do I get the corresponding chart x-value for a pixel point?

限于喜欢 提交于 2019-12-17 21:13:05
问题 How can I obtain the corresponding x-axis value (xIndex) of a pixel point in a ScatterChart? I have been looking through the source code of the library and I think that one of the methods below (which I copy/pasted from the source code from the library here) can help. It seems getValuesByTouchPoint is the correct method but I don't know how to use it. /** * Transformer class that contains all matrices and is responsible for * transforming values into pixels on the screen and backwards. * *

MPAndroidChart LineChart custom highlight drawable

拈花ヽ惹草 提交于 2019-12-17 19:38:11
问题 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 回答1: