Steven
Steven

Reputation: 3894

AndroidPlot and RectRegion

I am using Androidplot (v0.5.0) and I want segments of my plotted series to be different colours. I think I need to use RectRegion but the region never shows.

XYSeries series = new SimpleXYSeries(timestamps, item.getValues(), "");  
LineAndPointFormatter seriesFmt = new LineAndPointFormatter(
        Color.rgb(0, 200, 0),
        Color.rgb(0, 100, 0),
        Color.rgb(150, 190, 150));

XYRegionFormatter regionFmter = new XYRegionFormatter(Color.RED);
RectRegion region = new RectRegion(0, 10, 0, 10);
seriesFmt.addRegion(region, regionFmter);

I cant find the doco anymore for this but I can find old images from the old tutorials of what I was trying to achieve. http://androidplot.com/w/images/thumb/1/12/RectRegions_final.jpg/398px-RectRegions_final.jpgenter image description here

Upvotes: 0

Views: 255

Answers (1)

Nick
Nick

Reputation: 8317

Here's a link to the full source code that generated the graphic you posted - hopefully that provides answers you are looking for :)

https://androidplot.jira.com/source/browse/ANDROIDPLOT/trunk/Examples/DemoApp/src/com/androidplot/demos/XYRegionExampleActivity.java?hb=true

Upvotes: 1

Related Questions