无法显示图像(API setDrawIcons() 未找到错误)

Not able to show image (API setDrawIcons() not found error)

我在 android 项目中使用 MPAndroidChart 来显示图表,它非常有用。使用最新版本 3.0.1 (https://github.com/PhilJay/MPAndroidChart#usage)

我有一些要求在满足某些条件后在 BarEntry 顶部显示图像。在下载的示例代码中同样有效。

    BarDataSet set1;
    set1.setDrawIcons(true);// Cannot resolve method 'setDrawIcons(boolen)

为什么上面的 API 不是库 MPChartLib 的一部分,我在这里遗漏了什么吗?

整合MPChartLib源码后上述问题解决

  1. 文件 -> 项目结构
  2. 点击加号按钮添加新模块
  3. 导入Gradle项目
  4. 从源目录:并完成。

在 3.0.2 中添加了 setDrawIcons 方法。将 Gradle 选项更改为 compile 'com.github.PhilJay:MPAndroidChart:v3.0.2'