【问题标题】:Achart Engine for Line Graph In AndroidAndroid中用于线图的Achart引擎
【发布时间】:2014-06-16 06:34:56
【问题描述】:

我正在创建带有蓝光的折线图,其中点也以蓝色显示,我需要的是一种颜色的线和另一种颜色的线之间的点,感谢您的帮助。

【问题讨论】:

  • 为此,您必须修改 aCahrtEngine 源并重新编译它。

标签: android achartengine linegraph


【解决方案1】:

可能,修改库代码不是最好的主意,但它确实有效。 因此,您可以添加自己的 PointStyle 枚举并将颜色属性与 your_own_point_style_needed_color 添加到 ScatterChart 中。然后最后就是添加drawMyOwnPoint()之类的绘图方法

private void drawMyOwnPoint(Canvas canvas, SimpleSeriesRenderer renderer, Paint paint, float x, float y) {
        paint.setColor(renderer.getColor());
        canvas.drawCircle(x, y, size, paint);
        paint.setColor(renderer.getMyOwnNeededPointColor()); //here you get your point color
        canvas.drawCircle(x, y, size / 3 * 2, paint);
    }

并将其放在 public void drawLegendShape() 和 public void drawSeries() 方法中的 PointStyle case 子句中。然后从客户端代码中设置所需的 PointStyle 和 your_own_point_style_needed_color。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多