您的位置:首页 > 其它

achartengine之Demo学习6——demo中没使用的方法

2013-04-09 18:32 369 查看


运行demo可以发现,它的所有chart都是可以移动,背景色为黑。。。。不过我们有时候会希望chart不动或者改变背景色等一些样式。

这节就介绍一些demo中没有使用的但有很常见的一些关于设置renderer的方法

我也是一边看帮助文件一边在学习,下面的内容会不断更新,方便自己学习和查阅

1、//设置图形不可移动

org.achartengine.renderer.XYMultipleSeriesRenderer
setPanEnabled
public void setPanEnabled(boolean enabledX, boolean enabledY)
Sets the enabled state of the pan.
Parameters:
enabledX - pan enabled on X axis
enabledY - pan enabled on Y axis

org.achartengine.renderer.DefaultRenderer
setPanEnabled
public void setPanEnabled(boolean enabled)
Sets the enabled state of the pan.
Parameters:
enabled - pan enabled


2、//设置空白区的颜色,默认为黑色

org.achartengine.renderer.XYMultipleSeriesRenderer
setMarginsColor
public void setMarginsColor(int color)
Sets the color of the margins.
Parameters:
color - the margins color


3、//是否采用背景色,false下默认chart背景色为黑色,默认false

org.achartengine.renderer.DefaultRenderer
setApplyBackgroundColor
public void setApplyBackgroundColor(boolean apply)
Sets if the background color should be applied.
Parameters:
apply - the apply flag for the background color


4、//设置chart的背景颜色,不包括空白区

//要注意的是,改变chart背景颜色之前必须要先使用3中的方法
//即 setApplyBackgroundColor(true)
org.achartengine.renderer.DefaultRenderer
setBackgroundColor
public void setBackgroundColor(int color)
Sets the background color.
Parameters:
color - the background color
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐