AchartEngine 注释 [英] AchartEngine annotations

查看:25
本文介绍了AchartEngine 注释的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论我在哪里,我都能找到的唯一信息是通过以下代码添加它们

everywhere i look, the only information I can find says to add them via the following code

series.addAnnotation("Hello!!", 1, 1);

但是,当我在我的代码中尝试它时(使用正确的系列名称),我收到一条错误消息,指出不支持 addAnnotation.有人可以帮我解决这个问题吗?谢谢!

However, When I try it in my code (with the proper series name) I get an error message that says addAnnotation is not supported. Can someone please clear this up for me? thanks!

推荐答案

您必须下载库的最新版本.例如,从此处.

You must download a recent version of the library. For example, get the night build from here.

在您的代码中,将最后一行(您返回图表视图的那一行)替换为:

In your code, replace the last line (the one where you return the chart view) with:

XYMultipleSeriesDataset dataset = buildBarDataset(titles, values);
XYSeries series = dataset.getSeriesAt(0);
series.addAnnotation("Vacation", 6, 30);
return ChartFactory.getBarChartView(context, dataset, renderer, Type.STACKED);

这篇关于AchartEngine 注释的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆