我正在尝试使用android绘图库,只需复制示例页面的代码
http://androidplot.com/docs/quickstart/
我添加了库源,并在示例代码中更改了以下行,因为它给了我一个错误:
// Create a formatter to use for drawing 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);
我将最后一行更改为:
R.layout.line_point_formatter_with_plf1);
该程序需要几分钟才能编译并给出很多错误,如下所示
Android Dex:[prueba graficos] (org.eclipse.ui.internal.ide.IDEWorkbenchErrorHandler$1) 不附带
Android Dex:[prueba graficos] 关联的 EnclosureMethod 属性。这个类可能是由一个
Android Dex:[prueba graficos] 并且没有指定任何“-target”类型选项。忽视的后果
我的样式也有错误,在示例中样式为 style="@style/sample_activity" 但我没有那种样式,所以我只设置了布局大小。
并在 layout/xml/line_point_formatter_with_plf1.xml
<?xml version="1.0" encoding="utf-8"?>
<config
linePaint.strokeWidth="3dp"
linePaint.color="#00AA00"
vertexPaint.color="#007700"
fillPaint.color="#00000000"
pointLabelFormatter.textPaint.color="#FFFFFF"/>
config algo 这个词给了我一个错误:应该定义 layout_height 属性。