我正在使用MPAndroidChart库来渲染图表.使用时遇到了这段代码:
public void animateY(int durationmillis, Easing.EasingOption option);
Run Code Online (Sandbox Code Playgroud)
什么是动画缓和?Easing.EasingOption有什么用?
我正在使用这个令人敬畏的绘图仪框架ios-charts.Android版本的文档声明可以使用"setTouchEnabled(false)禁用图表上的触摸事件.但是我在iOS版本中找不到此功能."touchesBegan"可能会去这里吗?我是新的到iOS编程所以我不熟悉触摸事件.
我正在使用mpandroidchart库中的barchart.
我想隐藏x轴值,但我无法隐藏值.请帮我解决一下.我使用了以下代码,但它不起作用.
barChart.getXAxis().removeAllLimitLines();
Run Code Online (Sandbox Code Playgroud) 当一个数据集(大约6个或更多)到一个折线图时,我们得到一个例外.
这是详细信息:
java.lang.IllegalArgumentException: One or more of the DataSet Entry arrays are longer than the x-values array of this ChartData object.
at com.github.mikephil.charting.data.ChartData.isLegal(ChartData.java:173)
at com.github.mikephil.charting.data.ChartData.init(ChartData.java:130)
at com.github.mikephil.charting.data.ChartData.<init>(ChartData.java:96)
at com.github.mikephil.charting.data.BarLineScatterCandleData.<init>(BarLineScatterCandleData.java:27)
at com.github.mikephil.charting.data.LineData.<init>(LineData.java:27)
Run Code Online (Sandbox Code Playgroud)
我无法理解原因.
我正在使用MPAndroidChart来绘制图形.
输入更多数据集时,我们将获得该异常.
我正在使用MpAndroid图表库构建一个条形图,我大约有50到60个条形图并且想要显示最初的第60个条目,即显示ArrayList中的最后一个元素,并且滚动应该是从右到左.
主要动机是在图表条形图的初始加载期间显示图表的结尾.
提前致谢.
在我的Android应用程序中,我有一个使用MPAndroidChart的水平条形图。我的问题是我的条形图中有12个条形图,每个条形图表示从4月到3月的月份,但是我只能在x轴上看到替代月份的标签。少量的条,然后我可以看到x轴上的所有标签。我没有使用
xAxix.setLabelCount()
方法。那么为什么我看不到所有标签?如果我缩放了,那么我可以看到每个条的标签。我正在使用MPAndroidChart v3.0.1。上面的截图。请看这里,我只能看到'Apr,Jun,Aug,Oct,Dec,Feb'和所有其他月份未显示。如何查看其他所有月份。
下面是我的代码。
yVals1 = new ArrayList<BarEntry>();
xVals = new ArrayList<String>();
for (int i = 0; i < listChart.size(); i++){
BarEntry newBEntry = new BarEntry(i,listChart.get(i).getAmount());
xVals.add(listChart.get(i).getAltName());
yVals1.add(newBEntry);
}
BarDataSet set1;
set1 = new BarDataSet(yVals1, "");
set1.setColors(new int[] {Color.BLUE,Color.GREEN});
ArrayList<IBarDataSet> dataSets = new ArrayList<IBarDataSet>();
dataSets.add(set1);
BarData data = new BarData(dataSets);
data.setValueTextSize(10f);
barChartIncExp.setData(data);
barChartIncExp.setDrawBarShadow(false);
barChartIncExp.setDrawValueAboveBar(true);
barChartIncExp.getDescription().setEnabled(false);
barChartIncExp.setMaxVisibleValueCount(60);
// scaling can now only be done on x- and y-axis separately
barChartIncExp.setPinchZoom(true);
barChartIncExp.setDrawGridBackground(false);
barChartIncExp.setHighlightFullBarEnabled(false);
barChartIncExp.setHighlightPerDragEnabled(false);
XAxis xAxis = barChartIncExp.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawGridLines(false);
xAxis.setGranularity(1f); …Run Code Online (Sandbox Code Playgroud) 我正在使用MPAndroidChart库版本2.2.4.我的要求是我想在a中设置三个标记线,其BarChart值为"Minimum","Average"和"Maximum",如下图所示,但我找不到任何解决方案.
我是一个新的MPAndroidChart用户.
我已经在网上和维基中发现的例子在这里都给予了setDescription()的原型为:
setDescription(String desc)`
Run Code Online (Sandbox Code Playgroud)
但是,mChart.setDescription("");不能为我编译和AndroidStudio-> Go To Declaration告诉我Chart.java中定义的setDescription声明是:
public void setDescription(Description desc) {
this.mDescription = desc;
}
Run Code Online (Sandbox Code Playgroud)
Description.java中的Description构造函数不接受String.
如何设置描述(或至少将其关闭)?我指的是错误的图书馆吗?
这是我的应用程序的gradle文件:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} …Run Code Online (Sandbox Code Playgroud) 我目前正在为我的应用程序使用MPAndroidChart.在一个场景中,我在一个线图中显示三个数据集,当我单击图表上的线条时,我一次只显示一个工具提示.相反,基于十字线位置,我想显示所有三个数据集的单独工具提示.
我在这里遇到了很多其他问题,但我找不到我想要的东西.这是我所需输出的示例屏幕截图.我想知道这是否可行,并且非常感谢任何帮助.

我想制作折线图,但是我在xAxis中显示值字符串有问题,我使用了从MPAndroidChart到LineChart的Library Github 。请帮助我如何添加字符串值,实际上是我想问的很多问题
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.length; i++){
yEntrys.add(new Entry(yDataL[i] ,i));
}
for(int i = 1; i < xDataL.length; i++){
xEntrys.add(xDataL[i]);
}
//create the data set
LineDataSet lineDataset = new LineDataSet(yEntrys, "assa");
XAxis xAxis = lineChart.getXAxis();
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
xAxis.setDrawGridLines(false);
xAxis.setValueFormatter(new …Run Code Online (Sandbox Code Playgroud) mpandroidchart ×10
android ×9
bar-chart ×2
animation ×1
axis-labels ×1
ios-charts ×1
linechart ×1