0

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

Steven
  • 3,844
  • 3
  • 32
  • 53
  • What are the values returned by item.getValues()? – Nick Aug 11 '12 at 06:58
  • I was wondering if the values all fall outside the boundaries of the region defined? Any chance you can post a pic of what is currently being drawn in your implementation? – Nick Aug 11 '12 at 07:07

1 Answers1

1

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

Nick
  • 8,181
  • 4
  • 38
  • 63