I am using AndroidPlot to create a simple bar graphing app that displays some values in real time. I just started using it, so bear with me. There is a tutorial, which gives some basic info and then there are the JavaDocs that seem to give me everything including the kitchen sink.
My question now is: how do all the AndroidPlot classes fit together? I have a Plot, a Formatter and a Renderer, but I don’t seem to find a way to create a Renderer.
(to be a little more precise: I want a bar graph with bars that have some width and different colours per bar)
I think I found it out, it is not easily found in the docs. I found it here: https://androidplot.jira.com/source/browse/ANDROIDPLOT/trunk/Examples/DemoApp/src/com/androidplot/demos/OrientationSensorExampleActivity.java?hb=true
There is an
XYPlotobject (as found in the quickstart), where you can add aXYSeriesto. TheXYSeries, as well as aFormatter. To get theRenderer, you will need to tell that to theAddSeriesmethod call. Then, with thegetRenderercall and some casting, you can get theRenderer, where you can throw in some renderer-specific stuff.In code: