mpandroidchart

customize Legend in MPAndroidChart

元气小坏坏 提交于 2020-02-24 11:35:27
问题 I am working in project in project that needs implement chart , I decide use MPAndroidChart its work just fine but I need some things done to be perfect to me First can I change bars to specific image or it takes just images , as I have 3D image as bars in app design . Second Can I put the legend to the right of chart in two line like image below and change legend text color my java code mChart = (BarChart) view.findViewById(R.id.chart); mChart.setDescription(""); Legend mLegend = mChart

Listview with a MPAndroidChart(or whatever) below

心已入冬 提交于 2020-02-24 11:31:33
问题 Edit: I changed the title because isn't about MPAndroidChart, the same issue would happen with another view below the ListView. I am trying to set a layout for an activity in my android app. This activity consist on 2 elements, a ListView and a MPAndroidChart. What I would like to achieve is to place the ListView at top, taking the height that it needs ( wrap_content ) and below it the chart with a fixed height. I'm newbie on android, so the first thing I made was make a RelativeLayout with

MPAndroidChart绘制图形表

别等时光非礼了梦想. 提交于 2020-01-29 15:56:09
最近一个项目需要用到表格进行统计显示,本来用的是的achartengine,后来发现一个更加强大的开源框架MPAndroidChart。 下面简单介绍下MPAndroidChart,MPAndroidChart的效果还是蛮好的,提供各种动画,这个也是我使用MPAndroidChart,而且放弃achartengine的原因。 Github地址连接,后面是youtube上面演示MPAndroidChart的视频,MPAndroidChart由于提供了动画效果,为了兼容低版本的Android系统,MPAndroidChart需要添加nineoldandroids-2.4.0-2.jar作为依赖库,所以如果项目中使用这个表格库,需要同时导入这个两个jar,当然如果使用libproject的方式,就不用了。 https://github.com/PhilJay/MPAndroidChart https://www.youtube.com/watch?v=ufaK_Hd6BpI http://nineoldandroids.com/ 核心功能: 支持x,y轴缩放 支持拖拽 支持手指滑动 支持高亮显示 支持保存图表到文件中 支持从文件(txt)中读取数据 预先定义颜色模板 自动生成标注 支持自定义x,y轴的显示标签 支持x,y轴动画 支持x,y轴设置最大值和附加信息 支持自定义字体,颜色,背景

MPAndroidChart how to change the color of the bar chart past the limit line?

时光毁灭记忆、已成空白 提交于 2020-01-26 03:55:07
问题 How to change the color of the bar chart past the limit line? Now, bars that cross the limit line change color. But, I want to change the color of the part cross the limit line. 回答1: I think you can achieve that with stackedBarChart . Here in the docs you can see how to add the data for each bar. With this, you will set the data for a barchart as follows: BarEntry(xPosition, floatArray(belowLineNumber, aboverLineNumber) For the colors, you just need to add a list of colors fot the data set

Round Corners for both Negative and Positive bars of horizontal bar chart using MpAndroidChart

寵の児 提交于 2020-01-25 07:37:05
问题 I am trying to make the corners of horizontal bar chart rounded, here's the CustomChartRenderer code: package com.almaraiquest.Utils import android.graphics.* import com.github.mikephil.charting.animation.ChartAnimator import com.github.mikephil.charting.interfaces.dataprovider.BarDataProvider import com.github.mikephil.charting.interfaces.datasets.IBarDataSet import com.github.mikephil.charting.renderer.HorizontalBarChartRenderer import com.github.mikephil.charting.utils.ViewPortHandler

MPAndroidChart - why line not showing?

偶尔善良 提交于 2020-01-25 04:03:05
问题 I want to create a small application with a schedule. But for some reason, when I add a lot of points to the chart, it simply does not appear, although with a small number of points everything works. void f() { ArrayList<Entry> values = new ArrayList<>(); for (int i = x1, index = 0, j = y; i < x2; ++i, ++index) { float waveLength = (float) calib_a * i + (float) calib_b; int pixel = rotated.getPixel(i, j); float I = (Color.red(pixel) + Color.blue(pixel) + Color.green(pixel)) / 765.0f; values

com.mysugr.MPAndroidChart:MPAndroidChart:3.1.0-mysugr-1画图

痴心易碎 提交于 2020-01-24 20:33:47
MPAndroidChart画图 导入架包,是3.1.0版本的哦。 implementation 'com.mysugr.MPAndroidChart:MPAndroidChart:3.1.0-mysugr-1' xml布局中设置图形显示的位置,加id。 < com . github . mikephil . charting . charts . PieChart android : id = "@+id/pieChart" android : layout_width = "match_parent" android : layout_height = "match_parent" / > Java类中的核心代码!!! public class Paintyuan extends AppCompatActivity { PieChart pieChart ; ImageView imageView ; ArrayList < JSONObject > arrayList ; @Override protected void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . activity_yuan )

MPAndroidChart 柱状工具类

有些话、适合烂在心里 提交于 2020-01-24 08:24:01
撸友们老规矩直接上代码拿着玩去 /** * Created by czy * 柱状图工具 */ public class BarChartManager { /** * 不显示无数据的提示 * * @param mChart */ public static void NotShowNoDataText ( Chart mChart ) { mChart . clear ( ) ; mChart . notifyDataSetChanged ( ) ; mChart . setNoDataText ( "你还没有记录数据" ) ; mChart . setNoDataTextColor ( Color . WHITE ) ; mChart . invalidate ( ) ; } /** * 配置Chart 基础设置 * @param mChart 图表 * @param mLabels x 轴标签 * @param yMax y 轴最大值 * @param yMin y 轴最小值 * @param isShowLegend 是否显示图例 */ public static void configChart ( CombinedChart mChart , List < String > mLabels , float yMax , float yMin , boolean

MPAndroidChart setting chart padding / offset

会有一股神秘感。 提交于 2020-01-21 06:25:06
问题 I'm using the MPAndroidChart for my bar graph and I'm struggling with removing the padding of the graph (see pic below) My approaches regarding this problem were: chart.setDrawLegend(false); chart.setDrawMarkerViews(false); chart.setDrawUnitsInChart(false); chart.setDrawValueAboveBar(false); chart.setDrawXLabels(false); chart.setDrawYLabels(false); chart.setDescription(""); chart.setOffsets(0, 0, 0, 0); chart.getTransformer().prepareMatrixValuePx(chart); chart.getTransformer()

MPAndroid Line Chart single data point with curve

百般思念 提交于 2020-01-15 09:06:46
问题 I want linechart as follows. I want to show only specified point (blue circled should be there) (red circled should not be there). 回答1: I think of 2 methods. First: disable all points and values with lineDataSet.setDrawValues(dataSet.drawValues); lineDataSet.setDrawCircles(dataSet.drawValues); Then add another LineDataSet to the LineChart only containing that one point for the Maximum. This solution causes an additional entry in the Legend. The other solution would be a custom MarkerView like