Achartengine无法解析符号setLineWidth

时间:2015-07-29 04:59:38

标签: java android achartengine

我正在尝试在renderer中创建achartengine,但Android给了我这个错误:

Cannot resolve symbol setLineWidth

我似乎正在做正确的事,因为这是我的代码:

private XYSeriesRenderer renderer = new XYSeriesRenderer();
renderer.setLineWidth(2);

以下是我的导入:

import org.achartengine.model.XYSeries;
import org.achartengine.renderer.XYSeriesRenderer;

1 个答案:

答案 0 :(得分:1)

你必须在XYMultipleSeriesRenderer中循环所有渲染器,使用它:

int length = renderer.getSeriesRendererCount();
        for (int i = 0; i < length; i++) {
            XYSeriesRenderer seriesRenderer = (XYSeriesRenderer) renderer
                    .getSeriesRendererAt(i);                
            seriesRenderer.setLineWidth(2);
        }