Android Afreechart - Change point shape, thickness and color of line

限于喜欢 提交于 2019-12-08 02:45:35

问题


I am trying to change the shape of a line chart's points, in my app. I am using afreechart's TimeSeriesChart. I want to make this line fancy in terms of thickness, color and points shape. Where to change the code? which method will use for that?

What I'm having now:


(source: googlecode.com)

What I want:

om/svn/doc/screenshot/images/XYDrawableAnnotationDemo01.png)

As you can see, in the first chart, the points of the line chart are opaque and rectangle(square?), and in the second one, they are fancy. So, what needs to be changed? I cant seem to figure out the variable used to store this shape value nor how to change it. Any help appreciated. Thanks in advance..


回答1:


Assuming XYLineAndShapeRenderer, you'll need to condition the renderer to use the desired shape and make the outlines visible, a shown in this example.

renderer.setSeriesShape(0, circle);
renderer.setSeriesPaint(0, line);
renderer.setUseFillPaint(true);
renderer.setSeriesShapesFilled(0, true);
renderer.setSeriesShapesVisible(0, true);
renderer.setUseOutlinePaint(true);
renderer.setSeriesOutlinePaint(0, line);



来源:https://stackoverflow.com/questions/11383306/android-afreechart-change-point-shape-thickness-and-color-of-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!