mpandroidchart

MPAndroidChart Scatterchart in ListView

梦想与她 提交于 2020-01-05 09:47:59
问题 I am using the MPAndroidChart library. I have multiple scattercharts in a ListView. Every chart contains 365 xvalues (every day of the year). The yvalues vary from 1 to 5. The height of the charts is 150dp. I would like to be able to zoom in, so I can see every single day. But when I zoom in, the yvalues get out of range of the chart. Is there a way to keep the yvalues within range of the chart? I tried it with the next settings: holder.chart.setTouchEnabled(true); holder.chart.setDragEnabled

MPAndroidChart Scatterchart in ListView

穿精又带淫゛_ 提交于 2020-01-05 09:42:39
问题 I am using the MPAndroidChart library. I have multiple scattercharts in a ListView. Every chart contains 365 xvalues (every day of the year). The yvalues vary from 1 to 5. The height of the charts is 150dp. I would like to be able to zoom in, so I can see every single day. But when I zoom in, the yvalues get out of range of the chart. Is there a way to keep the yvalues within range of the chart? I tried it with the next settings: holder.chart.setTouchEnabled(true); holder.chart.setDragEnabled

MPAndroidChart white Background

若如初见. 提交于 2020-01-05 09:35:05
问题 I am using the MPAndroidChart library. I am setting the multi line chart with data using MPAndroidChart. It's working great but the background is coming white. This is what i am doing nhChart = new LineChart(getActivity()); nhChart.setDescription("Number of Hits View"); nhChart = (LineChart) hitsView.findViewById(R.id.line_chart_number_of_hits); //int color = Color.parseColor("#80101010"); nhChart.setBackgroundColor(Color.parseColor("#80101010")); //nhChart.setBackgroundResource(R.drawable

How to create scatter and line chart in same chart view?

时间秒杀一切 提交于 2020-01-05 09:34:55
问题 I know MPAndroidChart lets you put two linecharts in the same plot but I need to plot 2 scatter charts and one line chart in the same graph. How can go about doing this? 回答1: The functionality you are describing is not available in versions of the library prior to v3.0.0 EDIT : As of v3.0.0+, this feature is now available . It can be done using a CombinedChart . Check out the example to see how to implement it. 回答2: This functionality is now available. Check out the CombinedChart example. 来源:

MPAndroidChart white Background

会有一股神秘感。 提交于 2020-01-05 09:31:15
问题 I am using the MPAndroidChart library. I am setting the multi line chart with data using MPAndroidChart. It's working great but the background is coming white. This is what i am doing nhChart = new LineChart(getActivity()); nhChart.setDescription("Number of Hits View"); nhChart = (LineChart) hitsView.findViewById(R.id.line_chart_number_of_hits); //int color = Color.parseColor("#80101010"); nhChart.setBackgroundColor(Color.parseColor("#80101010")); //nhChart.setBackgroundResource(R.drawable

MPAndroidChart- How to add cells inside grids like Graph sheet?

谁说胖子不能爱 提交于 2020-01-05 07:45:11
问题 How to create a cells inside grids in MpAndroidchart library? Sample Image: https://i.stack.imgur.com/9fNd2.png 回答1: I think your best bet is to change the background of the chart. Since the chart is transparent by default, if you manage to get hold of the background picture like in your image, you could use the drawable and change the chart's background and tinker around with it. You could use this for your chart: In your XML : android:background="....." or setBackgroundResource(.....) in

MPAndroidChart- How to add cells inside grids like Graph sheet?

家住魔仙堡 提交于 2020-01-05 07:45:10
问题 How to create a cells inside grids in MpAndroidchart library? Sample Image: https://i.stack.imgur.com/9fNd2.png 回答1: I think your best bet is to change the background of the chart. Since the chart is transparent by default, if you manage to get hold of the background picture like in your image, you could use the drawable and change the chart's background and tinker around with it. You could use this for your chart: In your XML : android:background="....." or setBackgroundResource(.....) in

How to enable Scroll in a bar chart and align xAxis labels with the bar groups?

99封情书 提交于 2020-01-05 07:12:34
问题 Problem : 1. The x-axis values are not mapped with the group of the bars why? I have managed to show all the bar data by setting xAxis.axisMaximum = 50f but it is displaying a lot of "0" xAxis labels in the graph so how can i solve this? Here's the code : private fun populateCharts(chartData: List<ResponseGetPenetrationGrowth>){ try { val prev_year = ArrayList<BarEntry>() val current_year = ArrayList<BarEntry>() val xAxis_label = ArrayList<String>() var i = 0f val currentYear = Calendar

Can I draw a gradient linechart with mpAndroidChart?

血红的双手。 提交于 2020-01-04 02:07:11
问题 Can I draw a lineChart looks like in the picture? If can, what should I do to change the line colors? Thank you! what I have draw looks like the picture two,which the line is the same color and there is no yesterday incom.what should I do to change the line into gradient color and only show the last markerView ? The picture I have drawn. 回答1: I've found workaround! Please check this tutorial by Lance Gleason. It is pretty simple. Here is some code from it: @Override public void onStart() {

How to increase the horizontal chart value text size in MPAndroidChart

偶尔善良 提交于 2020-01-03 16:57:05
问题 I am using MPAndroidChart, I want to set the barchart values in center of the bar and with bigger font. mChart.setDrawValueAboveBar(false); By using the above the value is shown inside the bar but not at the center.I am using MpChart Thanks in advance 回答1: By default, it is not possible to center the values , you will have to add that feature yourself. Concerning the textsize, try: barDataSet.setValueTextSize(...) Styling individual DataSets Styling all ChartData 来源: https://stackoverflow.com