我正在努力寻找一个快速可靠的图表库.经过一番搜索,我发现4个库:AChartEngine,WilliamChart,HelloCharts和AndroidPlot.我需要一些关于这些库的性能和稳定性的最新反馈,因为我能找到的所有信息都已过时.
我想开发一个活动来在图中显示传感器数据.我一直环顾四周,我发现对我来说,更有趣的选项是achartengine和AndroidPlot.
我需要以下要求:
我认为两个lybraries都符合我的要求,但有人可以从他的经验中告诉我一个更好吗?哪一个更容易与应用程序集成?
绘制图表时遇到一个小问题.在下面的图片是我已经做过的.
该图表应代表可用Wi-Fi网络的实际信号强度.这是一个简单的XYPlot数据表示SimpleXYSeries(值是动态创建的).
这是一小段代码(仅举例):
plot = (XYPlot) findViewById(R.id.simplexyPlot);
series1 = new SimpleXYSeries(Arrays.asList(series1Numbers),
SimpleXYSeries.ArrayFormat.Y_VALS_ONLY, "Link 1");
f1 = new LineAndPointFormatter(color.getColor(), null,
Color.argb(60, color.getRed(), color.getGreen(), color.getBlue()), null);
plot.addSeries(series1, f1);
Run Code Online (Sandbox Code Playgroud)
图中的示例是dB变化的动态模拟.我想,一切正常,但我想要实现的是拥有"圆角"的角线(见图片,看看我的意思).
我已经尝试自定义LineFormatter:
f1.getFillPaint().setStrokeJoin(Join.ROUND);
f1.getFillPaint().setStrokeWidth(8);
Run Code Online (Sandbox Code Playgroud)
但这并没有像预期的那样奏效.

注意:Wifi Analyzer应用程序有一个类似的图形,其图形具有我想要的圆角.它看起来像这样:

似乎Androidplot(androidplot.com)网站/论坛已经关闭,所以我会尝试在这里提出这个问题.
我有多点触控缩放和滚动.与http://mlepicki.com/2012/03/androidplot-multitouch-zoom-scroll/相似的代码,只是我有一个条形图.然而,有100个数据点,它有明显的滞后.即使只有10个酒吧也在展示.听起来像它的绘图/计算/等所有条形图.
关于如何优化这个的任何想法?
我不能使用硬件渲染,因为我想支持Android 2.1并且库不支持它(它中断).
当我执行下面的代码并添加时 mySimpleXYPlot.getGraphWidget().getBorderPaint().setColor(Color.WHITE);
当我在我的设备上启动它时,应用程序崩溃了.
我想要完成的是摆脱整个图形周围的黑色边框.它位于图表的顶部,左侧和底部两侧约2厘米厚.有什么方法可以摆脱这个黑色的边界?
public class MainActivity extends Activity {
private XYPlot mySimpleXYPlot;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Create a couple arrays of y-values to plot:
Number[] days = { 1 , 2 , 3 , 4 , 5 , 6 , 7 };
Number[] values = { 380, 1433, 1965, 3200, 3651, 3215, 3217 };
// initialize our XYPlot reference:
mySimpleXYPlot = (XYPlot) findViewById(R.id.mySimpleXYPlot);
mySimpleXYPlot.getBackgroundPaint().setColor(Color.WHITE);
mySimpleXYPlot.setBorderStyle(XYPlot.BorderStyle.NONE, null, null);
mySimpleXYPlot.getGraphWidget().getBackgroundPaint().setColor(Color.WHITE);
mySimpleXYPlot.getGraphWidget().getGridBackgroundPaint().setColor(Color.WHITE);
// Domain
mySimpleXYPlot.getGraphWidget().setDomainLabelPaint(null);
mySimpleXYPlot.getGraphWidget().setDomainOriginLinePaint(null);
mySimpleXYPlot.setDomainStep(XYStepMode.INCREMENT_BY_VAL, …Run Code Online (Sandbox Code Playgroud) 是否可以创建具有固定x和y值的图表?我的x值类似于60,90,120,180,250,375,500,750,1000,但androidplot根据值之间的相等距离创建了9个不同的值.
Number[] timestamps = {60, 90, 120, 180, 250, 375, 500, 750, 1000};
Run Code Online (Sandbox Code Playgroud)
我正在使用mySimpleXYPlot.setDomainStep(XYStepMode.SUBDIVIDE,9); 我猜解决方案是围绕这个命令,但我不知道该怎么做.

完整代码:
mySimpleXYPlot = (XYPlot) findViewById(R.id.mySimpleXYPlot);
Number[] numSightings = {70, 63, 56, 49, 43, 37, 32, 27, 23};
Number[] timestamps = {
60, 90, 120, 180, 250, 375, 500, 750, 1000
};
// create our series from our array of nums:
XYSeries series2 = new SimpleXYSeries(
Arrays.asList(timestamps),
Arrays.asList(numSightings),
"USA");
mySimpleXYPlot.getGraphWidget().getGridBackgroundPaint().setColor(Color.WHITE);
mySimpleXYPlot.getGraphWidget().getGridLinePaint().setColor(Color.BLACK);
mySimpleXYPlot.getGraphWidget().getGridLinePaint().setPathEffect(new DashPathEffect(new float[]{1,1}, 1));
mySimpleXYPlot.getGraphWidget().getDomainOriginLinePaint().setColor(Color.BLACK);
mySimpleXYPlot.getGraphWidget().getRangeOriginLinePaint().setColor(Color.BLACK);
mySimpleXYPlot.setBorderStyle(Plot.BorderStyle.SQUARE, null, null);
mySimpleXYPlot.getBorderPaint().setStrokeWidth(1);
mySimpleXYPlot.getBorderPaint().setAntiAlias(false);
mySimpleXYPlot.getBorderPaint().setColor(Color.WHITE);
// Create a …Run Code Online (Sandbox Code Playgroud) 随着AndroidPlot网站的关闭,我有点陷入这个问题.已经提出了几个类似的问题,但没有一个得到适当的回答,所以我走了.
我想知道如何重新标记我的X轴.例如,如果我想绘制关于月度数据的值,我会(1, 82)为Januari,(2,67)Februari 绘制它,依此类推.之后,我想将X标签更改[1, 2, 3, ...]为x_labels = ["Januari", "Februari", ...].我怎样才能做到这一点?
哦,请提供一个答案,x_labels可以是任何东西(如果有一些特定的月度标签方法,你永远不知道).
谁可以帮忙?谢谢!
我知道AndroidPlot有一个论坛,但它不是最活跃的,所以我有机会在这里...
我正在尝试使用AndroidPlot库从XY绘图中删除系列指示符或绘图图例.我不想从剧情本身删除这个系列,只是传说.
我已经看到它在AndroidPlot示例上完成但是由于文档有限,很难找到方法去做像删除legen这样的东西
我用androidplot从我的数据库制作了一个图表,但是当我用按钮重置数据库时,图形dosnt更新,如何在不重新创建活动的情况下更新图形?
public class Overview extends Activity {
Number[] seriesOfNumbers;
private XYPlot mySimpleXYPlot;
// double totalprofitd;
private BetsDbAdapter dbHelper;
TextView NBtext;
TextView TOtext;
TextView TPtext;
TextView ROItext;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.c_overview);
dbHelper = new BetsDbAdapter(this);
TOtext = (TextView) findViewById(R.id.turnover);
TPtext = (TextView) findViewById(R.id.totalprofit);
NBtext = (TextView) findViewById(R.id.numberOfBet);
ROItext = (TextView) findViewById(R.id.roi);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.android_tab_layout, menu);
return true; …Run Code Online (Sandbox Code Playgroud) 我想显示用户尝试的问题/答案会话的折线图和条形图。我正在使用AndroidPlot 0.6.0。会话日期时间是域,范围是用Yes或回答的问题计数No。
问题:包含单个项目的列表在图形中未显示任何内容。例如,用户第一次会话:

至少包含两个项目的列表正确显示图形。该图正确显示了两个会话,其中日期作为域,计数是/否作为范围:


我的线图代码如下:
XYSeries answeredYesSeries = new SimpleXYSeries(answeredYesList,
SimpleXYSeries.ArrayFormat.Y_VALS_ONLY,
// Y_VALS_ONLY means use the element index as the x value
"Answered Yes"); // Title of this series
// Create a formatter to use for draw ing a series using
// LineAndPointRenderer
// and configure it from xml:
LineAndPointFormatter series1Format = new LineAndPointFormatter();
series1Format.setPointLabelFormatter(new PointLabelFormatter());
series1Format.configure(getApplicationContext(),
R.xml.line_point_formatter_with_plf1);
// add count of questions answered with yes series to the xyplot:
xyPlot.addSeries(answeredYesSeries, series1Format);
XYSeries …Run Code Online (Sandbox Code Playgroud)