AChartEngine混乱的标签 [英] AChartEngine Messed up labels
问题描述
我的图表显示正常,但是当我滚动到侧面时,出现了随机的时间,并且弄乱了日期,请参见此图:
http://img14.imageshack.us/img14/8329/statqs.jpg
<我只想显示日期,什么都不显示,我不知道渲染器会如何计算我从未输入的时间。
我也想知道如何防止向左滚动(x轴)和向下滚动(负y),我不能再使用SetPanLimits,因为我的x值是日期而不是数字。
任何帮助将不胜感激!
我知道这已经很老了,但是对于下一个用户来说,找到解决方法可能会有所帮助。
您可以指定要使用的日期格式
/ **
*创建一个时间表意图,可用于启动图形视图
*活动。
*
* @param context上下文
* @param数据集多系列数据集(不能为空)
* @param渲染器多系列渲染器(不能为空)
* @param格式化用于显示X轴
*日期标签的日期格式模式。如果为null,将使用默认的适当格式。
* @返回时间表意图
* @throws IllegalArgumentException如果数据集为null或渲染器为null或
*如果数据集和渲染器不包括相同数量的
*系列
* /
公共静态最终Intent getTimeChartIntent(上下文上下文,XYMultipleSeriesDataset数据集,
XYMultipleSeriesRenderer渲染器,字符串格式){
return getTimeChartIntent(context,dataset,renderer,format ,);
}
仅显示日期和月份,请使用以下内容:
意图intent = ChartFactory.getTimeChartIntent(上下文,数据集,mRenderer, dd-MMM);
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!
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");
这篇关于AChartEngine混乱的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!