【问题标题】:AChartEngine Messed up labelsAChartEngine 搞砸了标签
【发布时间】:2011-09-24 18:00:36
【问题描述】:

我的图表显示正常,但只要我滚动到一边,我就会随机出现时间并且它会弄乱日期,请看这张图片: http://img14.imageshack.us/img14/8329/statqs.jpg

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

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

任何帮助将不胜感激!

【问题讨论】:

  • 我也有同样的问题。你能告诉我你是否解决了它,plx?谢谢
  • 我也是,有人会说怎么解决?

标签: date time scroll achartengine


【解决方案1】:

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

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

/**
 * 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");

【讨论】:

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