AChartEngine 标签混乱

发布于 2024-12-06 14:09:24 字数 317 浏览 1 评论 0原文

我的图表显示良好,但一旦我滚动到一侧,就会出现随机时间,并且它会弄乱日期,请参见这张图片: http://img14.imageshack.us/img14/8329/statqs.jpg

我只想显示日期而不显示其他内容,我不知道渲染器如何得出我从未输入的时间。

另外我想知道如何防止向左(x 轴)和向下(负 y)滚动,我不能再使用 SetPanLimits 因为我的 x 值是日期而不是数字。

任何帮助将不胜感激!

My chart displays fine but as soon as I scroll to the side, I have random time appearing and it messes up the dates, see this picture:
http://img14.imageshack.us/img14/8329/statqs.jpg

I'd like to only display the date and nothing else, I don't know how the renderer comes up with time that I never entered.

Also I'd like to know how I can prevent scrolling to the left (x axis) and down (negative y), I can no longer use SetPanLimits because my x values are dates and not numbers.

Any help would be greatly appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

国产ˉ祖宗 2024-12-13 14:09:24

我知道这已经很老了,但对于下一个用户来说,找到解决方案可能会有所帮助。

您可以指定要使用的日期格式

/**
 * Creates a time chart intent that can be used to start the graphical view
 * activity.
 * 
 * @param context the context
 * @param dataset the multiple series dataset (cannot be null)
 * @param renderer the multiple series renderer (cannot be null)
 * @param format the date format pattern to be used for displaying the X axis
 *          date labels. If null, a default appropriate format will be used.
 * @return a time chart intent
 * @throws IllegalArgumentException if dataset is null or renderer is null or
 *           if the dataset and the renderer don't include the same number of
 *           series
 */
  public static final Intent getTimeChartIntent(Context context, XYMultipleSeriesDataset dataset,
  XYMultipleSeriesRenderer renderer, String format) {
        return getTimeChartIntent(context, dataset, renderer, format, "");
  }

要仅显示日期和月份,请使用如下所示的格式:

Intent intent = ChartFactory.getTimeChartIntent(context, dataset, mRenderer, "dd-MMM");

I know this is very old, but for the next user, it may help to have the solution.

You can specify the date format to use

/**
 * Creates a time chart intent that can be used to start the graphical view
 * activity.
 * 
 * @param context the context
 * @param dataset the multiple series dataset (cannot be null)
 * @param renderer the multiple series renderer (cannot be null)
 * @param format the date format pattern to be used for displaying the X axis
 *          date labels. If null, a default appropriate format will be used.
 * @return a time chart intent
 * @throws IllegalArgumentException if dataset is null or renderer is null or
 *           if the dataset and the renderer don't include the same number of
 *           series
 */
  public static final Intent getTimeChartIntent(Context context, XYMultipleSeriesDataset dataset,
  XYMultipleSeriesRenderer renderer, String format) {
        return getTimeChartIntent(context, dataset, renderer, format, "");
  }

To show only day and month, use something like the following:

Intent intent = ChartFactory.getTimeChartIntent(context, dataset, mRenderer, "dd-MMM");
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文